Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Visual C: Obtaining __int64 value from a DLL

Reply
Thread Tools

Visual C: Obtaining __int64 value from a DLL

 
 
kgpsoftware@gmail.com
Guest
Posts: n/a
 
      03-13-2006
Hi folks,

I have a DLL which contains functions that return __int64 values, but I
can't get Visual C to read the return value correctly. I am using the
2003 version.

Here is the declare:

__int64 __stdcall TEST(void);

...and the calling code:

__int64 ret;
ret = TEST();

In all cases, ret is zero. Is there a special compiler switch I need to
use, or is this not supported? Could the problem lie in the .lib
header?

Thanks for any assistance.

 
Reply With Quote
 
 
 
 
Flash Gordon
Guest
Posts: n/a
 
      03-13-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Hi folks,
>
> I have a DLL which contains functions that return __int64 values, but I
> can't get Visual C to read the return value correctly. I am using the
> 2003 version.
>
> Here is the declare:
>
> __int64 __stdcall TEST(void);


__int64 and __stdcall are not part of standard C and therefore off topic
here (we only deal with standard C not MS or POSIX or any other
extensions of 3rd party libraries).

> ..and the calling code:
>
> __int64 ret;
> ret = TEST();
>
> In all cases, ret is zero. Is there a special compiler switch I need to
> use, or is this not supported? Could the problem lie in the .lib
> header?


It would be easier to answer your question if you had provided a
complete compilable example showing your problem. As it is, the problem
could be on any of the 9237834 lines of code you have not shown us. My
guess is line 42 of forgotten_stuff.h

Actually, a real possibility is that you don't have a declaration for
TEST in scope when you call it. Without a declaration the compiler is
required to assume TEST returns an int which is not the case here (MSVC
only supports C90 not C99, so C99 rules don't apply).

If that does not help you go to one of the microsoft groups and post a
small *complete* example showing your problem. Don't bring the
non-standard code here.
--
Flash Gordon, living in interesting times.
Web site - http://home.flash-gordon.me.uk/
comp.lang.c posting guidelines and intro:
http://clc-wiki.net/wiki/Intro_to_clc
 
Reply With Quote
 
 
 
 
Vladimir S. Oka
Guest
Posts: n/a
 
      03-13-2006
On Monday 13 March 2006 16:47, (E-Mail Removed) opined (in
<(E-Mail Removed) .com>):

> Hi folks,
>
> I have a DLL which contains functions that return __int64 values, but
> I can't get Visual C to read the return value correctly. I am using
> the 2003 version.


You should really ask this in a M$ Windows oriented group. It's
off-topic here (only ISO Standard C is on-topic).

> Here is the declare:
>
> __int64 __stdcall TEST(void);
>
> ..and the calling code:
>
> __int64 ret;
> ret = TEST();
>
> In all cases, ret is zero. Is there a special compiler switch I need
> to use, or is this not supported? Could the problem lie in the .lib
> header?


Have you considered the possibility that 0 is the correct result?
Nothing in your post indicates that `TEST` does not terminate with a
`return 0;` statement. In other words, even if your question were on
topic, you did not provide enough information for anyone to help you.

--
BR, Vladimir

Q: What's the difference between USL and the Titanic?
A: The Titanic had a band.

 
Reply With Quote
 
kgpsoftware@gmail.com
Guest
Posts: n/a
 
      03-13-2006
>If that does not help you go to one of the microsoft groups and post a
>small *complete* example showing your problem. Don't bring the
>non-standard code here.


Ok, will do. Sorry for being off topic.

 
Reply With Quote
 
Rod Pemberton
Guest
Posts: n/a
 
      03-13-2006

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Hi folks,
>
> I have a DLL which contains functions that return __int64 values, but I
> can't get Visual C to read the return value correctly. I am using the
> 2003 version.
>
> Here is the declare:
>
> __int64 __stdcall TEST(void);
>
> ..and the calling code:
>
> __int64 ret;
> ret = TEST();
>


An '__int64' is just a 'long long'. It appears correct to me. Perhaps
connect to www.openwatcom.org and subscribe to openwatcom.users.c_cpp. The
OW compiler supports most MS calling conventions.


Rod Pemberton


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Obtaining a Character value from a Unicode (numeric) value david Java 7 10-10-2012 02:38 PM
__int64 vs. long long Tim Clacy C++ 8 11-10-2003 03:29 PM
msvcrt.dll, msvcirt.dll, msvcrt20.dll and msvcrt40.dll, explanation please! Snoopy NZ Computing 16 08-25-2003 12:34 PM
unsigned __int64 overflow problem Vivi C++ 2 08-25-2003 06:09 AM
Re: Different results if compared as double or __int64? John Tsiombikas (Nuclear / the Lab) C++ 1 06-30-2003 02:31 PM



Advertisments