[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: trying again to write dll for ts6



PureBytes Links

Trading Reference Links

> Secondly, if you are using C++, you have to know that function
> names are normally "mangled". 

Mike took care of that with the 'extern "C"' declaration.

> The error I receive from TS6 when this indicator is turned on is:
> The instruction at "0x03764e3c" referenced memory at "0x00000001".
> The memory could not be "read". 

I haven't done much DLL work, and none with TS6, but:  that's a 
runtime error that probably means you were referencing an invalid 
pointer.  It looks like the pointer had a value of "1" instead of a 
valid address.

One possibililty is that your fopen() call failed.  But I think 
fopen() returns NULL for failures, not 1.  In any case it's a good 
idea to error-check your return values before you reference the 
pointer.

I think the problem is in your fprintf().  You print "group" with a 
%s (string) directive, but "group" is an int -- with a value of 1, 
hmmmm.  %s expects a pointer to a string.  It tried to indirect 
through the value you passed it -- 1 -- and barfed.

Gary