Pass String from Vb.net application to VC++ dll in pocket PC 2003

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi All,

I have created a win 32 dll using Visual Studio 2005 for Smart device and
using pocket PC 2003 SDK.
I am able to call exported function from VB.net and C# application.
If i have integer parameters in my function it works fine. But the problem
is that when i pass string parameter it's value is not passing to VC++ dll
function.
What is the problem?

Sample code of dll :
char* _stdcall getstring(char* str)

{

return str;


}

Sample code of vb.net application

Public Declare Function getstring Lib "mydll.dll" (ByVal pstr As String) As
String

msgbox(getstring("Test String"))



When i debug my dll the value of string parameter is "".

Please reply me soon.

Regards,

Rakesh


.



Relevant Pages

  • Re: Explicit Linking of DLLs in VB.net
    ... yes this technique will only work on managed assemblys (exe or dll) ... "YourObject" is a form and is limited to the form methods. ... Wel implement propertys, methods, events in your interface and start ... Public Shared Function LoadMeByName(ByVal vstrAssemblyName As String, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Explicit Linking of DLLs in VB.net (attn Michel or any others)
    ... loads the dll and finds a form in the dll. ... Dim extForm As Form = extAssembly.CreateInstance("test.entry", ... Wel implement propertys, methods, events in your interface and start ... Public Shared Function LoadMeByName(ByVal vstrAssemblyName As String, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Access crashes when calling DLL function.
    ... I have started bypassing code in the form to find the problem. ... are local String variables. ... I then built a simple input form (in the same mdb) that calls the crashing ... functions from a DLL they provide. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Populating CString in Win32 dll interface that accepts LPCTSTR
    ... ReleaseBuffer() if I actually modify the buffer after GetBuffer is called ... But the OP wanted the string to be "populated" by the DLL. ... Unicode or ANSI string, but the DLL might think it is a non-const pointer to an ANSI ...
    (microsoft.public.vc.mfc)
  • Re: VB6 generates faulty exe code: UDT passed from VB6 to DLL
    ... pAnything is being used as a pointer to the string the VB UDT ... The C dll assumes that the string has a null ... Why is there padding in the temp location of the UDT when passed to the C ... Visual Basic Requirements for Exported DLL Functions ...
    (microsoft.public.vb.bugs)