Host Engineering Forum

General Category => Ethernet SDK => Topic started by: JMB on August 12, 2011, 02:31:49 PM

Title: Updated VC Samples
Post by: JMB on August 12, 2011, 02:31:49 PM
Hi All,

I've attached a very straightforward update of the Visual C EtherCCM sample.  I did the following things:

- updated the project to Visual Studio 2008
- replaced the timeGetTime() function with a version that doesn't require the multimedia library
- removed some of the unnecessary Win32 parts
- switched to using version 3 of the HEI library
- changed some of the integer data types to match their usage and eliminate a few compiler warnings
- added a bit of error reporting to the main() method (specific return codes)

I've tested this against an H4-ECOM and an H2-ECOM100 that I have on my corporate network in both Debug and Release builds and it appears to function correctly.  If anyone has any comments, (constructive)criticisms or finds any problems - let me know.

I intend to do the same thing with the other samples over the next little while but I don't have access to any ERM/EBC/etc hardware to test against so someone else will have to try them out.

Thanks,
Jacob
Title: Re: Updated VC Samples
Post by: chrisatwan on August 12, 2011, 10:25:34 PM
Jacob,

I have a complete setup in my office so I can test any code you need help with.

Thanks,
Christopher
Title: Re: Updated VC Samples
Post by: chrisatwan on August 13, 2011, 09:38:03 AM
Jacob,

I am taking my lumps with Visual C. I am getting a hei32_3 not found when trying to execute EtherCMM.exe

It builds fine.

Thanks,
Christopher
Title: Re: Updated VC Samples
Post by: BobO on August 13, 2011, 10:35:21 AM
It's looking for ether32_3.dll, the file that actually does all of the work. It just needs to be somewhere that Windows normally loads DLLs from...which could be the directory you are running etherccm.exe from or the Windows directory.
Title: Re: Updated VC Samples
Post by: chrisatwan on August 14, 2011, 12:42:56 PM
I was incorrect about error before, the program is looking for hei32_2.dll and not hei32_3.dll

Any thoughts on this?


Thanks,
Christopher
Title: Re: Updated VC Samples
Post by: JMB on August 15, 2011, 02:21:04 PM
That seems odd since I set up both the Debug and Release builds to link against hei32_3.lib so it should only want hei32_3.dll.  Either way, set up post-build events with this command line:

copy "$(ProjectDir)\Lib\hei32_2.dll" "$(ProjectDir)\$(OutDir)\"
copy "$(ProjectDir)\Lib\hei32_3.dll" "$(ProjectDir)\$(OutDir)\"

This should copy both .dlls into the same directory as the final executable on a successful build.

Jacob
Title: Re: Updated VC Samples
Post by: chrisatwan on August 15, 2011, 04:14:42 PM
Jacob,

I retraced my steps and it is working fine now. I had the change:

WORD Protocol = HEIP_IPX;

to

WORD Protocol = HEIP_IP;

Which solved my next problem. I am going to play with this along with trying to get my VB6 dll working. I am able to find the ECOM but unable to write or read from it with the dll.


Thanks,
Christopher