Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>I have to disclaim this as I have no experience doing it, but merely found that it should be possible given some reading of the docs on the subject.</strong></p> <p>I'm not sure you'll have much luck with the VB to .NET import/conversion process if there is a lot of low level stuff going on. The existing dll is likely a COM object, no?</p> <p>It seems like there is some MSDN documentation to get you started from C++ using COM object dlls - and it looks like the <code>#import</code> directive will generate some .h (header) files as well.</p> <p><a href="http://msdn.microsoft.com/en-us/library/8etzzkb6.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/8etzzkb6.aspx</a></p> <p>So I would try simply adding an <code>#import</code> directive for it.</p> <p><code>#import "somelibrary.dll"</code> </p> <p>and see what visual studio generates. </p> <p>Have a look at the following example as well, (copied shamelessly from another forum)</p> <pre><code> #import "F:\proj\VB6\ActiveXDLL\VBTestDLL.dll" using namespace VBTestLib; void CDialogTestDlg::OnButton1() { HRESULT hresult; CLSID clsid; _CTest *t; // a pointer to the CTest object _bstr_t bstrA = L"hello"; _bstr_t bstrB = L" world"; _bstr_t bstrR; ::CoInitialize(NULL); hresult=CLSIDFromProgID(OLESTR("VBTestLib.CTest"), &amp;clsid); hresult= CoCreateInstance(clsid,NULL,CLSCTX_INPROC_SERVER, __uuidof(_CTest),(LPVOID*) &amp;t); if(hresult == S_OK) { bstrR = t-&gt;vbConcat(bstrA , bstrB); AfxMessageBox((char*)bstrR); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload