|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Pass string from vb.net 2005 to c dllI have a function call to a C DLL which takes a string as a parameter, and
modified the string. I keep getting the following error. I beleive I have to marshal the string, but I am unsure how to do that. Error; Attempted to read or write protected memory. This is often an indication that other memory is corrupt. "Bob Simoneau" <bobsimoneau@newsgroups.nospam> wrote in message Instead of passing a string, try passing a StringBuilder (and defining the news:%23WuVe1GcGHA.3956@TK2MSFTNGP05.phx.gbl... >I have a function call to a C DLL which takes a string as a parameter, and >modified the string. I keep getting the following error. I beleive I have >to marshal the string, but I am unsure how to do that. > > Error; > Attempted to read or write protected memory. This is often an indication > that other memory is corrupt. > function to pass a StringBuilder as well). HTH, Mythran "Bob Simoneau" <bobsimoneau@newsgroups.nospam> schrieb: I suggest to post the function prototype in C and the 'Declare' or >I have a function call to a C DLL which takes a string as a parameter, and >modified the string. I keep getting the following error. I beleive I have >to marshal the string, but I am unsure how to do that. 'DllImport' you are using in VB.NET. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Also try putting a copy of the dll in the system32 directory of your system.
-- Show quoteHide quoteGet a powerful web, database, application, and email hosting with KJM Solutions http://www.kjmsolutions.com "Bob Simoneau" <bobsimoneau@newsgroups.nospam> wrote in message news:%23WuVe1GcGHA.3956@TK2MSFTNGP05.phx.gbl... >I have a function call to a C DLL which takes a string as a parameter, and >modified the string. I keep getting the following error. I beleive I have >to marshal the string, but I am unsure how to do that. > > Error; > Attempted to read or write protected memory. This is often an indication > that other memory is corrupt. >
Read Emails on Exchange server without OL client
VB2005 timing/speed problem File Names: List Long file Names from Database List of short file names Recursive WebRequest.Create() Call Lisp Program from vb.net help logging events to txt file set focus from treeview to control Compiling internally instead of as a DLL? Invalid format of DLL How do I take a screenshot in VB.net 2005 |
|||||||||||||||||||||||