Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get a STRUCT value
Message
From
16/09/2015 12:52:51
 
General information
Forum:
Visual FoxPro
Category:
West Wind Web Connection
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01624698
Message ID:
01624710
Views:
70
This message has been marked as a message which has helped to the initial question of the thread.
>Hi Gang!
>
>This is a continuation of a thread I started earlier......
>
>I have a dotNET DLL called RBA_SDK_CS.dll that was thrown at us to use..... (without consultation of course). This dll is to interface between our FOXPRO app and an Ingenico Credit Card swipe and signature pad.
>
>Unfortunately, I cannot access the methods, properties or events of the dll in VFP (sigh...).
>
>So, I can use Rick Strahl's wwwDotNetBridge to try and access the dll and use it.
>
>I can do this so far with the dll...
>
>
>CLOSE ALL
>CLOSE DATABASES
>CLEAR DLLS 
>
>do wwDotNetBridge
>PUBLIC loBridge as wwDotNetBridge
>loBridge = CreateObject("wwDotNetBridge")
>
>PUBLIC loRBA as Object
>
>loBridge.LoadAssembly("RBA_SDK_CS.DLL")
>loRBA	= loBridge.CreateInstance("RBA_SDK.RBA_API")
>lntest	= loBridge.Invokemethod(loRBA, "Initialize")
>
>
>But now I need to be able to do this C# line of code...
>
>var CommSet = new SETTINGS_COMMUNICATION();
>
>
>where the SETTINGS_COMMUNICATIONS is a type of STRUCT.
>
>and here are the STRUCTS properties..
>
>CommSet.interface_id = (uint)COMM_INTERFACE.SERIAL_INTERFACE;
>CommSet.rs232_config.ComPort = "COM8";// cmbCommPort.Text;
>CommSet.rs232_config.BaudRate = 115200;//Convert.ToUInt32(cmbBaudRate.Text);
>CommSet.rs232_config.DataBits = 8;//Convert.ToUInt32(cmbByteSize.Text);
>CommSet.rs232_config.Parity = 0;//(uint)cmbParity.SelectedIndex;
>CommSet.rs232_config.StopBits = 1;//Convert.ToUInt32(cmbStopBits.Text);
>CommSet.rs232_config.FlowControl = 0;//(uint)cm
>
>
>I saw in some online discussions where Rick uses this to access STATIC PROPERTIES....
>
>*** Retrieve a static property which is an object
> loConfig = loBridge.GetStaticProperty("Westwind.WebLog.App","Configuration")
>
> *** I could also instantiate the config object directly
> *loConfig = loBridge.CreateInstance("Westwind.WebLog.App")
>
>
>I tried some variations of this, but I could not get the loConfig to instatiate... I keep getting .NULL. for it and the error message returned is
>
>"Type not loaded. Please load call LoadAssembly first"
>
>So, can anyone help me, please? My job is on the line here ...... ( time to learn C# for real now, I guess.... sigh...)
>
>attached is a screenshot of the DLL in the object browser of Visual Studio
>
>Thanks!
>Tommy

Hi Tommy

Try downloading Struct.zip from here:

http://www.foxpert.com/downloads.htm

It explains how to create structs to use in VFP.
Previous
Reply
Map
View

Click here to load this message in the networking platform