.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help converting C# code to VB.net

3 REPLIES 3
Reply
Message 1 of 4
ralstogj
419 Views, 3 Replies

Help converting C# code to VB.net

Hi

 

I am trying to convert the C# code included in this post

http://forums.autodesk.com/t5/NET/Dynamic-Input/td-p/1339772144

for an undocumented method acedSetDynInputDisplayMessage to vb.net

i am having trouble converting these lines of code C# code to vb.net


       [DllImport("acad.exe",EntryPoint="?acedSetDynInputDisplayMessage@@YA_N_N@Z")]
    private static extern bool acedSetDynInputDisplayMessage(bool displayMessageOnce);


    'Using VB.net example syntax From this website post
    'http://through-the-interface.typepad.com/through_the_interface/2006/07/calling_objecta.html

    Private Declare Auto Function acedSetDynInputDisplayMessage Lib "acad.exe" Alias "?acedSetDynInputDisplayMessage@@YA_N_N@Z" _
    (<MarshalAs(UnmanagedType.LPWStr)> ByVal acedSetDynInputDisplayMessage As Boolean) As Boolean

 

However it only works in part due to the second (bool displayMessageOnce) missing not sure how to include this in the vb.net code

any recommendations on how I do this in vb.net would be apprieciated.

 

Regards

 

Justin Ralston

 

Regards

 

 

Justin Ralston

Regards

Justin Ralston
http://c3dxtreme.blogspot.com/
3 REPLIES 3
Message 2 of 4
Jeff_M
in reply to: ralstogj

I think this should work, but I don't use VB so it's just a best guess based on other similar posts:

 

   Private Declare Auto Function acedSetDynInputDisplayMessage Lib "acad.exe" Alias "?acedSetDynInputDisplayMessage@@YA_N_N@Z" _
    (displayMessageOnce As Boolean) As Boolean

Jeff_M, also a frequent Swamper
EESignature
Message 3 of 4
chiefbraincloud
in reply to: ralstogj

This is how I have done it for other things.  (This is what the converter at CodeFusion spits out, as well)

 

<Runtime.InteropServices.DllImport("acad.exe", EntryPoint:="?acedSetDynInputDisplayMessage@@YA_N_N@Z")> _

Private Shared Function acedSetDynInputDisplayMessage(ByVal displayMessageOnce As Boolean) As Boolean

End Function

 

 

Dave O.                                                                  Sig-Logos32.png
Message 4 of 4
Anonymous
in reply to: ralstogj

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report