-
August 19th, 2002, 03:23 PM
#1
#import "MSVBVM60.DLL" error
I only have one statement "#import "MSVBVM60.DLL" no_namespace" in my VC6. 0 code. when I compile it, I got error message:
d:\sampl\debug\msvbvm60.tlh(577) : error C2059: syntax error : '('
If I add include file<afxwin.h>
I will have additional error message:
d:\sample\debug\msvbvm60.tlh(451) : error C2059: syntax error : '('
why it has error in msvbvm60.tlh?
Anyone know the reason for this error?
Thanks.
-
August 19th, 2002, 05:06 PM
#2
Hi,
the syntax error occurs in the tlh-file at the function declaration
VARIANT_BOOL __stdcall EOF(
short FileNumber );
Well, EOF is a #define in one or more standard C include files - the most important is stdio.h where it is defined as #define EOF (-1)
My first thought was to ommit the no_namespace-attribute but it doesn't work. But I have two other solutions:
1. Use the rename-attribute - for example:
#import "MSVBVM60.DLL" rename("EOF","VBAEOF") rename("RGB","VBARGB")
or
2. undefine the EOF/RGB constant before the import and define it again after the import statement:
#undef EOF
#import ...
#define EOF (-1)
I definitively suggest option 1.
Helmut
-
August 19th, 2002, 05:07 PM
#3
I agree, option 1 is definitely better.
-
August 20th, 2002, 10:53 AM
#4
-
April 27th, 2013, 10:31 PM
#5
Re: #import "MSVBVM60.DLL" error
u want send me complete sample?
-
April 28th, 2013, 08:42 AM
#6
Re: #import "MSVBVM60.DLL" error
After 11 years, there's a chance he's not even around this forum anymore!
Be sure to rate those who help!
-------------------------------------------------------------
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
-
April 29th, 2013, 05:50 PM
#7
Re: #import "MSVBVM60.DLL" error
u have this code!
#include "stdafx.h"
#include <stdlib.h>
#include "windows.h"
#import "MSVBVM60.DLL" raw_interfaces_only no_implementation named_guids rename_namespace ("vb6") rename ("EOF", "vbEOF") rename ("RGB", "vbRGB") rename ("GetObject", "vbGetObject")
using namespace vb6;
int _tmain(int argc, _TCHAR* argv[])
{
VARIANT v565;
v565.intVal=2;
float v533;
*(float *)&v533 = Rnd(&v565);
return 0;
}
when build (vstudio 2012) ...this errors:
Error 2 error LNK1120: 1 unresolved externals
Error 1 error LNK2019: unresolved external symbol "float __stdcall vb6::Rnd(struct tagVARIANT *)" (?Rnd@vb6@@YGMPAUtagVARIANT@@@Z) referenced in function _wmain
Can helpme?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|