cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Toolkit DLL used in VB.Net

Ketan_Lalcheta
19-Tanzanite

Toolkit DLL used in VB.Net

Hello ,

I would like to access functions from c++ dll having toolkit API into VB.Net.

I am able to use dllimport properly for functions which does not have any of the toolkit API. With toolkit API, function does not work properly and gives Access Violation error.

Please suggest me on same. I can provide more details if require.

Regards

Ketan


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
6 REPLIES 6

Guys,

I have seen application with foreign GUI. Could be built in MFC. Any idea on this? Unfortunately, PTC technical support does not entertain foreign GUI queries.

Is this the right place for this question?

Thanks and Regards

Ketan

Hi,

You need to export C++ method and import DLL using DLLImport in vb.net

Ex:

Exporting Sample C++ code:

EXPORT char* GetCurrentDrawingName()

{

     static char cDrwName[PRO_NAME_SIZE];

     //Do Your code here

      return cDrwName;

}

Importing sample vb.net code:

Module WrapperImport

<DllImport("CreoWrapper.dll", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.StdCall)> _

    Public Function GetCurrentDrawingName() As

End Function

End Module

Public Function GetCurrentDrawingName() As String

        Dim sReturn As String = -1

        sReturn = Marshal.PtrToStringAnsi(WrapperImport.GetCurrentDrawingName())

        Return sReturn

End Function

Hi,

I had tried this way back. I was able to use function of dll by dllimport in VB.Net for functions which does not involve Toolkit API.

Are you able to use dll functions properly which is having at least one toolkit API?

Thanks and Regards

Ketan

hello,

I am new with toolkit ,do you have some documents for visual basic user guide, I can't find it anyway.

thanks.

Leo Zhang wrote:

I am new with toolkit ,do you have some documents for visual basic user guide, I can't find it anyway.

Do you have the Visual Basic API installed? It should be under Common Files\vbapi  .
If you do, then the documentation is under  Common Files\vbapi\vbapidoc .

|+|  M a r k  |+|

Also you can find examples or sample code to startup at installation directory @ C:\Program Files\PTC\Creo 2.0\Common Files\M120\vbapi\vbapi_examples

Announcements


Top Tags