Re: native dll access error - Attempted to read or write protected memory



Hi,
Thanks for your messages, but I am still stuck.
I am moved a step further, though. I was getting the last error message
bcoz I was calling the native function incorrectly. It required a 3rd
parameter by reference that gets populated by the pwd.

But I don't get anything back from the native function. It seems that
the data type doesn't seem to be right because the function is not able
to lookup the server and username.
I am 100% sure that the native call works because the provided test EXE
works.

I have tried passing the foll formats:

int status = getPwd(chArrServer, chArrUser, ref chArrPwd);
int status = getPwd(strServer, strUser, ref strPwd);
int status = getPwd(ptrServer, ptrUser, ref ptrPwd);

Following is a c++ code that works. But I need to do this in my asp.net
2.0/c# app
int pwStatus;
char pwd[256];
char user[256];
char server[256];

pwStatus= getPwd(server, user, pwd);

Ideas???

Thanks,
Hiral

.



Relevant Pages

  • Re: Passing NULL Objects
    ... long accountNumber){int accNum=0; ... public Integer searchAccounts(Vector bankAccounts) { ... int value, which is a primitive, only to an object. ... lookup, I'd pass back a false in the boolean, followed by the error message ...
    (comp.lang.java.help)
  • Re: operator function
    ... >> of them have anything to do with what the error message seems ... Setting (int h, int m, int s, int TT) ... Now the compiler knows, that it is safe to use that function on a const ... >> operator returns a Setting object. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: question
    ... "int main{" ... you printed an error message and terminated the program. ... You're asking fread() to read 512 element, ... it's conventional to print error messages to stderr, ...
    (comp.lang.c)
  • Re: question
    ... "int main{" ... you printed an error message and terminated the program. ... You're asking fread() to read 512 element, ... it's conventional to print error messages to stderr, ...
    (comp.lang.c)
  • Re: Using MessageBox
    ... Here is the error message. ... String* caption, unsigned int type); ... MClass* pm = new MClass; ... add System.Windows.Forms to your namespace list (I've never used ...
    (microsoft.public.dotnet.framework.clr)

Loading