Click here to Skip to main content
15,914,413 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCRT .dll's for Winsock Pin
Aaron Schaefer18-Sep-02 11:13
Aaron Schaefer18-Sep-02 11:13 
GeneralPassing strings from VC to a VB COM dll Pin
ns18-Sep-02 11:11
ns18-Sep-02 11:11 
GeneralRe: Passing strings from VC to a VB COM dll Pin
ns18-Sep-02 11:28
ns18-Sep-02 11:28 
GeneralRe: Passing strings from VC to a VB COM dll Pin
ns18-Sep-02 11:35
ns18-Sep-02 11:35 
GeneralRe: Passing strings from VC to a VB COM dll Pin
Bart Robeyns18-Sep-02 12:12
Bart Robeyns18-Sep-02 12:12 
GeneralRe: Passing strings from VC to a VB COM dll Pin
ns_18-Sep-02 13:50
sussns_18-Sep-02 13:50 
GeneralRe: Passing strings from VC to a VB COM dll Pin
Anonymous18-Sep-02 21:08
Anonymous18-Sep-02 21:08 
GeneralRe: Passing strings from VC to a VB COM dll Pin
ns19-Sep-02 1:19
ns19-Sep-02 1:19 
I tried your method and still got the compile error:

C:\msway\mswayView.cpp(169) : error C2664: 'SysAllocString' : cannot convert parameter 1 from 'char *' to 'const unsigned short *'


My VB dll function that I'm passing to has the signature:

Public Function MakeDB(txtPMAFilename As String, dataBaseName As String)


and I just tried:

  CString dataBaseName0 = "C:\\Image.mdb";

  CString strFile0 = "C:\\Trainer\\final1.txt";

  char* dataBaseName = new char[dataBaseName0.GetLength() +1];

  strcpy(dataBaseName, dataBaseName0);

  <code>_bstr_t b_dataBaseName = SysAllocString (dataBaseName);</code>

   char* strFile = new char[strFile0.GetLength() +1];

  strcpy(strFile, strFile0);

<code>  _bstr_t b_strFile = SysAllocString (strFile);</code>

   //short st1;
  // Declare the Interface Pointer for your Visual Basic object. Here,
  // _Class1Ptr is the Smart pointer wrapper class representing the
  // default interface of the Visual Basic object.

  _Class1Ptr ptr;
  // Create an instance of your Visual Basic object, here
  // __uuidof(Class1) gets the CLSID of your Visual Basic object.

   ptr.CreateInstance(__uuidof(Class1));

    <code>ptr->MakeDB( b_strFile, b_dataBaseName);</code>

    SysFreeString (b_dataBaseName);

    SysFreeString (b_strFile);

GeneralRe: Passing strings from VC to a VB COM dll Pin
Bart Robeyns19-Sep-02 11:21
Bart Robeyns19-Sep-02 11:21 
GeneralFinal question...I hope Pin
ns19-Sep-02 11:37
ns19-Sep-02 11:37 
GeneralRe: Passing strings from VC to a VB COM dll Pin
Michael Dunn18-Sep-02 12:02
sitebuilderMichael Dunn18-Sep-02 12:02 
GeneralRe: Passing strings from VC to a VB COM dll Pin
ns_18-Sep-02 13:52
sussns_18-Sep-02 13:52 
GeneralRe: Passing strings from VC to a VB COM dll Pin
ns19-Sep-02 1:03
ns19-Sep-02 1:03 
GeneralGUI front end Pin
WhiteLegend18-Sep-02 10:57
WhiteLegend18-Sep-02 10:57 
GeneralRe: GUI front end Pin
Ravi Bhavnani18-Sep-02 11:05
professionalRavi Bhavnani18-Sep-02 11:05 
GeneralRe: GUI front end Pin
xai18-Sep-02 11:19
xai18-Sep-02 11:19 
QuestionWhat path to code in #import? Pin
ns18-Sep-02 10:45
ns18-Sep-02 10:45 
AnswerRe: What path to code in #import? Pin
Michael Dunn18-Sep-02 10:45
sitebuilderMichael Dunn18-Sep-02 10:45 
GeneralRe: What path to code in #import? Pin
ns18-Sep-02 10:55
ns18-Sep-02 10:55 
GeneralRe: What path to code in #import? Pin
Michael Dunn18-Sep-02 11:58
sitebuilderMichael Dunn18-Sep-02 11:58 
GeneralRe: What path to code in #import? Pin
Jon Hulatt18-Sep-02 22:25
Jon Hulatt18-Sep-02 22:25 
GeneralQuestion about CSocket Pin
nachilau18-Sep-02 9:36
nachilau18-Sep-02 9:36 
GeneralRe: Question about CSocket Pin
Daniel Turini18-Sep-02 9:56
Daniel Turini18-Sep-02 9:56 
QuestionHow to make an Incomming connection Pin
Joe O'Connor18-Sep-02 9:02
Joe O'Connor18-Sep-02 9:02 
Questionhow to debug a VB dll called from VC Pin
ns18-Sep-02 8:59
ns18-Sep-02 8:59 

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.