Host Engineering Forum
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
February 08, 2012, 06:25:37 am


Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Visual C demo code  (Read 1742 times)
chrisatwan
Full Member
***
Posts: 30



« on: January 27, 2010, 04: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.
Logged
BobO
Host Moderator
*****
Posts: 1114


Yes Pinky, we *are* going to control the world!


« Reply #1 on: January 28, 2010, 01: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.
Logged

BobO

The Constitution does not guarantee us freedom from being offended...but we can choose not to be, and life gets so much easier.
chrisatwan
Full Member
***
Posts: 30



« Reply #2 on: January 28, 2010, 08: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?
Logged
BobO
Host Moderator
*****
Posts: 1114


Yes Pinky, we *are* going to control the world!


« Reply #3 on: January 28, 2010, 08:13:01 pm »

Yep.
Logged

BobO

The Constitution does not guarantee us freedom from being offended...but we can choose not to be, and life gets so much easier.
chrisatwan
Full Member
***
Posts: 30



« Reply #4 on: January 29, 2010, 09: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?
Logged
MikeS
Host Moderator
*****
Posts: 171



WWW
« Reply #5 on: January 29, 2010, 09: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
Logged

Good design costs a lot. Bad design costs even more.
chrisatwan
Full Member
***
Posts: 30



« Reply #6 on: January 29, 2010, 09: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.

Logged
chrisatwan
Full Member
***
Posts: 30



« Reply #7 on: January 29, 2010, 11:45:15 am »

I just looked in EtherCCM.cpp and found:

WORD Protocol = HEIP_IPX

Logged
MikeS
Host Moderator
*****
Posts: 171



WWW
« Reply #8 on: January 29, 2010, 02: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.
Logged

Good design costs a lot. Bad design costs even more.
chrisatwan
Full Member
***
Posts: 30



« Reply #9 on: January 29, 2010, 03: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?
Logged
BobO
Host Moderator
*****
Posts: 1114


Yes Pinky, we *are* going to control the world!


« Reply #10 on: January 29, 2010, 07: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.



Logged

BobO

The Constitution does not guarantee us freedom from being offended...but we can choose not to be, and life gets so much easier.
chrisatwan
Full Member
***
Posts: 30



« Reply #11 on: March 13, 2010, 03: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
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM