String from VB to VC
-
Please help me I lost my night sleep. Tell in simple code. From my VB client I am passing simple string "Siddharth", to a win32 dll function GetUserName(DATATYPE)(if DAtatype is BSTR or wstring tell me how to convert it into string in dll function declaration). My program should run in 98 as well as NT. I am trying lot of examples but they all are for long. When I convert it to string nothing works out. VB client Dim x as string x = "String" GetStringFromVb(wstring *) end Win32 GetStringFromVb(wstring*) { vector MyString; MyString.push_back(wstring); { //..Lot of string manipulation } } One more issue. in the win32 DLL.h if I declare stl parameter, it is not accepted by the compiler.
-
Please help me I lost my night sleep. Tell in simple code. From my VB client I am passing simple string "Siddharth", to a win32 dll function GetUserName(DATATYPE)(if DAtatype is BSTR or wstring tell me how to convert it into string in dll function declaration). My program should run in 98 as well as NT. I am trying lot of examples but they all are for long. When I convert it to string nothing works out. VB client Dim x as string x = "String" GetStringFromVb(wstring *) end Win32 GetStringFromVb(wstring*) { vector MyString; MyString.push_back(wstring); { //..Lot of string manipulation } } One more issue. in the win32 DLL.h if I declare stl parameter, it is not accepted by the compiler.
Widebytetomultibyte will help you convert wstring to string. But since the input is from VB i guess it must be BSTR so to convert BSTR to string put USES_CONVERSION as the first line in the function and when you want to convert BSTR to string use this macro OLE2A to finish the job.
Still Alive!!! Thank you God.
-
Widebytetomultibyte will help you convert wstring to string. But since the input is from VB i guess it must be BSTR so to convert BSTR to string put USES_CONVERSION as the first line in the function and when you want to convert BSTR to string use this macro OLE2A to finish the job.
Still Alive!!! Thank you God.
Bulls eye boss, in identifying the problem. Really U are great. I am trying it. Will get back to you. One point I want to clarify USES_CONVERSION is not included in Index part of MSDN. Nor OLE2A
-
Bulls eye boss, in identifying the problem. Really U are great. I am trying it. Will get back to you. One point I want to clarify USES_CONVERSION is not included in Index part of MSDN. Nor OLE2A
SiddharthAtw wrote: Really U are great humm, ab chane ke jhad pe mat chada. ;)
Still Alive!!! Thank you God.
-
SiddharthAtw wrote: Really U are great humm, ab chane ke jhad pe mat chada. ;)
Still Alive!!! Thank you God.
Meri kya aukaat ki guru logo ke chana ka Jhad par chadao. It gave me breather, believe me.Right now experimenting with the issue. :-D
-
Bulls eye boss, in identifying the problem. Really U are great. I am trying it. Will get back to you. One point I want to clarify USES_CONVERSION is not included in Index part of MSDN. Nor OLE2A
include atlconv.h for uses_conversion stuff also you can refer this link for futher understanding USES_CONVERSION[^] its not a complete doc but its good to understand and about the link in MSDN try searching it, i guess its in of the knowledge base article.
Still Alive!!! Thank you God.
-
SiddharthAtw wrote: Really U are great humm, ab chane ke jhad pe mat chada. ;)
Still Alive!!! Thank you God.