News:

  • May 17, 2026, 03:58:00 AM

Login with username, password and session length

Author Topic: Visual C demo code  (Read 41746 times)

chrisatwan

  • Full Member
  • ***
  • Posts: 30
Visual C demo code
« on: January 27, 2010, 03:35:35 PM »
Tried using ETHERCCM in visual c++ but I am getting error that can't find HEI32_2.dll

I am unable to register HEI32_2.dll, which I thought might fix problem.

I can execute all other Visual C demo programs except ETHERCMM.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6156
  • Yes Pinky, Do-more will control the world!
Re: Visual C demo code
« Reply #1 on: January 28, 2010, 12:29:00 PM »
Hmmm...

Those samples have not been updated in an eternity. It appears that the project is referencing HEI32_2.DLL rather than HEI32_3.DLL. Go into the linker settings and change it to the _3 version and it should build.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

chrisatwan

  • Full Member
  • ***
  • Posts: 30
Re: Visual C demo code
« Reply #2 on: January 28, 2010, 07:09:59 PM »
Changing the link to HEI32_3 and it executed fine. So all I need to do is include this in my project and call the functions?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6156
  • Yes Pinky, Do-more will control the world!
Re: Visual C demo code
« Reply #3 on: January 28, 2010, 07:13:01 PM »
Yep.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

chrisatwan

  • Full Member
  • ***
  • Posts: 30
Re: Visual C demo code
« Reply #4 on: January 29, 2010, 08:18:11 AM »
I have a ECOM module connected to PC which I have been communicating with a visual basic test program using visual basic demo code and it works. I have the visual c demo code running, ETHERCMM, but it doesn't not find ECOM. I have ETHERCMM in debug, stepping through program but do not see where my problem is. Any ideas?

MikeS

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 261
    • Host Engineering, Inc.
Re: Visual C demo code
« Reply #5 on: January 29, 2010, 08:44:57 AM »
my first guess would be that the Visual C version of EtherCCM is using IPX protocol and the VB version is using TCP/IP. So if the PC doesn't have that protocol available, you'd get that result.

The call to HEIOpenTransport should fail if IPX isn't available though .... hmmm
Good design costs a lot. Bad design costs even more.

chrisatwan

  • Full Member
  • ***
  • Posts: 30
Re: Visual C demo code
« Reply #6 on: January 29, 2010, 08:58:23 AM »
I stepped through the program and I am getting a 2 from:

TP.Protocol = Protocol

Another confusing thing is that I only have a cat5 cable from ECOM to PC and I am getting a DeviceCount of 20 in debug. Unless that is because DeviceCount = MAX_DEVICES, which equals 20.


chrisatwan

  • Full Member
  • ***
  • Posts: 30
Re: Visual C demo code
« Reply #7 on: January 29, 2010, 10:45:15 AM »
I just looked in EtherCCM.cpp and found:

WORD Protocol = HEIP_IPX


MikeS

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 261
    • Host Engineering, Inc.
Re: Visual C demo code
« Reply #8 on: January 29, 2010, 01:48:20 PM »
yep, ur using IPX protocol. have you checked the VB program to see if it is using IPX as well? or is it using IP? Changing it to TCP/IP protocol only requires that you change that value to HEIP_IP. But make sure which protocol the VB app is using, no need to add another variable to the problem if we don't have to.

As for DeviceCount, that variable gets set in the HEIQueryDevices call to the number of HEI devices that answer the broadcast query, so having a value of 20 in that variable at this point shouldn't be a concern.
Good design costs a lot. Bad design costs even more.

chrisatwan

  • Full Member
  • ***
  • Posts: 30
Re: Visual C demo code
« Reply #9 on: January 29, 2010, 02:08:52 PM »
I changed the WORD Protocol = HEIP_IPX to WORD Protocol = HEIP_IP and it found the ECOM.

The Parse command line section of code is not running. I go into debug and it steps right over the following line:

for(int Parm = 1; Parm < argc; Parm++)

I modified line but I get exception error on following line:

if(argv[Parm][0] == '/' || argv[Parm][0] == '-')

Any more thoughts?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6156
  • Yes Pinky, Do-more will control the world!
Re: Visual C demo code
« Reply #10 on: January 29, 2010, 06:22:39 PM »
It is walking through all parms that are entered on the command line. If there are none, it won't enter that code. If you have typed commands, and argc doesn't reflect the proper count, I have no clue. I suspect that your command line is empty.

If you changed the code to force the parse of a parameter array that doesn't actually contain any parameters, it will definitely blow up.

None of that code is required, however. It is just there to make it easy to change behavior without recompiling. Hardcode stuff the way you want it and run with it.



"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

chrisatwan

  • Full Member
  • ***
  • Posts: 30
Re: Visual C demo code
« Reply #11 on: March 13, 2010, 02:21:07 PM »
I am trying to connect to an ECOM with a specific IP address using the visual c++ demo and have inserted the following into the code:

   memset(aDevices, 0, 2);
   memset(aDevices, 1, 0);
   memset(aDevices, 2, 0x70);
   memset(aDevices, 3, 0x70);
   memset(aDevices, 4, 192);
   memset(aDevices, 5, 168);
   memset(aDevices, 6, 43);
   memset(aDevices, 7, 202);

I was looking at how it was being done in the visual basic example but I am unable to connect using the visual c++ demo. I worked in the visual basic example.


Thank you,
Christopher Atwan