Click here to Skip to main content
16,006,768 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
JokeRe: using swap to make assignment operator exception safe Pin
CPallini8-Jan-08 3:54
mveCPallini8-Jan-08 3:54 
GeneralRe: using swap to make assignment operator exception safe Pin
George_George8-Jan-08 3:06
George_George8-Jan-08 3:06 
GeneralRe: using swap to make assignment operator exception safe Pin
George_George8-Jan-08 3:16
George_George8-Jan-08 3:16 
GeneralRe: using swap to make assignment operator exception safe Pin
George_George8-Jan-08 2:33
George_George8-Jan-08 2:33 
GeneralRe: using swap to make assignment operator exception safe Pin
George_George8-Jan-08 2:30
George_George8-Jan-08 2:30 
GeneralRe: using swap to make assignment operator exception safe Pin
toxcct8-Jan-08 2:37
toxcct8-Jan-08 2:37 
GeneralRe: using swap to make assignment operator exception safe Pin
George_George8-Jan-08 3:13
George_George8-Jan-08 3:13 
GeneralStrange error ! Pin
CrocodileBuck8-Jan-08 0:26
CrocodileBuck8-Jan-08 0:26 
Hi,

when I pass a String from VB to C++dll, the code will work, the string will appear on a MessageBox called from the Dll.
When i click Ok the following error message appears: "Wrong Dll_Calling Convention" !!!????

The Code
VB:
<br />
Private Declare Function fnWin32DLL02 Lib "E:\WORKING\OMRON\GDT\EigeneDLL\C++ DLL mit VB (Test01)\Win32DLL02.dll" (ByVal a As String) As String<br />
<br />
Private Sub Form_Load()<br />
    <br />
   Dim s As String<br />
    <br />
   s = "Übergabe aus VB"<br />
   fnWin32DLL02 (s)<br />
    <br />
End Sub<br />


Cpp:
<br />
WIN32DLL02_API BSTR fnWin32DLL02(LPCSTR s)<br />
{<br />
	// BSTR x;(LPCSTR)<br />
	// x = SysAllocString (L"hhh");<br />
	MessageBox(NULL,s,"Info",MB_OK); <br />
	return  CComBSTR (BSTR("abc"));<br />
}<br />


When i change the LPCSTR s to BSTR s, ...the same error appears !

Could you imagine where the error comes fom ?

Many Thanx and best regards
Croc
GeneralRe: Strange error ! Pin
CPallini8-Jan-08 0:39
mveCPallini8-Jan-08 0:39 
GeneralRe: Strange error ! Pin
CrocodileBuck8-Jan-08 0:54
CrocodileBuck8-Jan-08 0:54 
GeneralYou're welcome Pin
CPallini8-Jan-08 1:50
mveCPallini8-Jan-08 1:50 
GeneralRe: Strange error ! Pin
Matthew Faithfull8-Jan-08 0:49
Matthew Faithfull8-Jan-08 0:49 
GeneralRe: Strange error ! Pin
CrocodileBuck8-Jan-08 1:12
CrocodileBuck8-Jan-08 1:12 
GeneralHandling the message by minimizing using "Windows key+D" Pin
Mohammad Khodaea8-Jan-08 0:10
Mohammad Khodaea8-Jan-08 0:10 
GeneralRe: Handling the message by minimizing using "Windows key+D" Pin
toxcct8-Jan-08 0:13
toxcct8-Jan-08 0:13 
GeneralRe: Handling the message by minimizing using "Windows key+D" Pin
Mohammad Khodaea8-Jan-08 1:44
Mohammad Khodaea8-Jan-08 1:44 
GeneralRe: Handling the message by minimizing using "Windows key+D" Pin
Rajesh R Subramanian8-Jan-08 2:01
professionalRajesh R Subramanian8-Jan-08 2:01 
QuestionRe: Handling the message by minimizing using "Windows key+D" Pin
David Crow8-Jan-08 3:18
David Crow8-Jan-08 3:18 
GeneralRe: Handling the message by minimizing using "Windows key+D" Pin
Rajesh R Subramanian8-Jan-08 3:29
professionalRajesh R Subramanian8-Jan-08 3:29 
GeneralRe: Handling the message by minimizing using "Windows key+D" Pin
David Crow8-Jan-08 3:36
David Crow8-Jan-08 3:36 
GeneralRe: Handling the message by minimizing using "Windows key+D" Pin
Rajesh R Subramanian8-Jan-08 3:39
professionalRajesh R Subramanian8-Jan-08 3:39 
JokeRe: Handling the message by minimizing using "Windows key+D" Pin
toxcct8-Jan-08 3:48
toxcct8-Jan-08 3:48 
JokeRe: Handling the message by minimizing using "Windows key+D" Pin
Rajesh R Subramanian8-Jan-08 3:50
professionalRajesh R Subramanian8-Jan-08 3:50 
JokeRe: Handling the message by minimizing using "Windows key+D" Pin
toxcct8-Jan-08 3:52
toxcct8-Jan-08 3:52 
GeneralRe: Handling the message by minimizing using "Windows key+D" Pin
Rajesh R Subramanian8-Jan-08 3:56
professionalRajesh R Subramanian8-Jan-08 3:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.