|
I think what you wrote is correct. I used to code NI's drivers with many of such struct typedefs.
And 3 minutes ago I copied your struct and pasted onto a console project and a MFC project, both of them compiled without an error!
Maybe you post the entire build log, and we could find out what happened.....
Maxwell Chen
No code is good code.
|
|
|
|
|
Where is the entire build log located?
|
|
|
|
|
You may rebuild all again, and copy the content in the Build tab of the Output window.
Or you may copy what in the .plg file....
Maxwell Chen
No code is good code.
|
|
|
|
|
Anonymous wrote:
when i define it that way Visual C++ compiler says: "error C2011: '_ID3Info' : 'struct' type redefinition"
From the looks of it, it seems that _ID3Info is somehow aready defined. It could be that:
1. You have a struct of that name defined somewhere else
2. Perhaps you don't have "include guards" in the header file that defines the struct, and it is getting pulled in twice. I always do something like this to ensure that #2 does not happen:
#ifndef _whatever_your_h_file_name_happens_to_be_
#define _whatever_your_h_file_name_happens_to_be_
(code of the include file goes here)
#endif
No generalization is 100% true.
Not even this one.
|
|
|
|
|
Navin wrote:
#ifndef _whatever_your_h_file_name_happens_to_be_
#define _whatever_your_h_file_name_happens_to_be_
(code of the include file goes here)
#endif
You could also use:
#pragma once
instead of the above ... however the above woudl be the more standard way of doing things
(-_-)
|
|
|
|
|
Brian Delahunty wrote:
#pragma once
Yes, my way would be more "standard", but yours is prettier.
No generalization is 100% true.
Not even this one.
|
|
|
|
|
Navin wrote:
Yes, my way would be more "standard", but yours is prettier.
Thanks
(-_-)
|
|
|
|
|
Like Navin, your struct compiles fine in my code. I think if you follow his advice you'll find the source of your problem.
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
Navin wrote:
#ifndef _whatever_your_h_file_name_happens_to_be_
#define _whatever_your_h_file_name_happens_to_be_
(code of the include file goes here)
#endif
You could also use:
#pragma once
instead of the above ... however the above woudl be the more standard way of doing things
(-_-)
|
|
|
|
|
Again some newbie-problems
I want to use the AVIFile API in my c++ project. Including the "Vfw.h" header file is not a problem, the various datatypes such as PAVIFILE can be used.
But when the project tries to link to the windows dll (mswfv32.dll), the linker says:
Linking...
AviKaka.obj : error LNK2001: unresolved external symbol _AVIFileInit@0
AviKaka.obj : error LNK2001: unresolved external symbol _AVIFileExit@0
Debug/MultiKaka.exe : fatal error LNK1120: 2 unresolved externals
I've already tried to add the dll manualy in project->settings->debug->additional_dlls
So, I guess this is probably a how-to-call-a-dll-topic
Inluding the headerfile is not enough
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Are you sure that the definition and prototype of _AVIFileInit is the same?
|
|
|
|
|
Yep, source found on msdn library.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
There are two ways to use a DLL:
1) static use
You need a header-file and a lib-file added to your project. Than you can directly call the functions declared in the header file.
(Due to the linker errors it seems the lib-file is missing in your project, adding only the dll won`t work)
2) dynamic use
You only need the dll-file. From your source you load the dll by calling LoadLibrary() and get the function pointers by calling GetProcAdress().
So far ... RockNix///
------------------------------------
www.klangwerker.de
Need some articles about Threading,
Subclassing, Double Buffering ?
Go for it ...
Look out for free Win32
Serial Communication Module
for VC++ or Borland C++ Builder
Visit us on www.klangwerker.de
------------------------------------
|
|
|
|
|
the lib-file is not missing. checked it.
Is there a way to view the dll member functions, (not the headerfile)? maybe they've changed.
If I use it dynamicaly, can I use the dll-functions more or less in the same manner?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
frisco wrote:
Is there a way to view the dll member functions
Use the depends.exe tool comes with your VC++.
Maxwell Chen
No code is good code.
|
|
|
|
|
Within Visual Studio 6.0 there is a tool called "DUMPBIN".
Copy this to your DLL Path and type the following line from a console:
dumpbin /exports yours.dll
A list of the exported functions should be shown.
So far ... RockNix///
------------------------------------
www.klangwerker.de
Need some articles about Threading,
Subclassing, Double Buffering ?
Go for it ...
Look out for free Win32
Serial Communication Module
for VC++ or Borland C++ Builder
Visit us on www.klangwerker.de
------------------------------------
|
|
|
|
|
Add vfw32.lib in Project|Settings|Link, Object/Library modules. It's not a static lib but an import lib (you can tell because it contains only names). Your exe will link at runtime to the right dll and more importantly will compile ok too. tried just now with this fantastic test program:
#include <windows.h>
#include <vfw.h>
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int) {
AVIFileInit();
AVIFileExit();
return 0;
}
(I think you can only do the thing with putting libs into your project with static libraries, which contain code as well as import names, but I'm not sure.)
|
|
|
|
|
I've included the Vfw.h header file, but the lib-file is called vfw32.lib and its in Microsoft Visual Studio\VC98\LIB
Does the added 32 cause any harm here?
The lib dir is good?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
And I've checked the lib for _AVIFileInit@0 and it's in it, allright.
I'm missing something here.
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
You need to make sure the Vfw32.lib is included in the ProjectSettings->Link->Input->Object/library modules properties.
Michael
Communication is the first step towards enlightenment.
|
|
|
|
|
That's it, allright!
I thought that the linker uses the standard libraries in vc98\lib directory by default. But you have to include them on the link-tab. I did that only for the debug-tab.
Mike, you're the man
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Why handler WM_NCLBUTTONDOWN inside CEdit does not receive the notify at click of the mouse outside it?
Best regards,
Eugene Pustovoyt
|
|
|
|
|
From MSDN
WM_NCLBUTTONDOWN
The WM_NCLBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
Michael
Communication is the first step towards enlightenment.
|
|
|
|
|
I'm not capture the mouse!!!
Eugene Pustovoyt
|
|
|
|
|
Hi Eugene,
The WM_NCLBUTTONDOWN message is only generated when a mouse is clicked on the nonclient area of the edit control (ie. the border, the one or two pixel wide area around the client area), it is not generated when the mouse is clicked outside the control.
What Michael was refering to is that once the mouse has been captured (via SetCapture()), all mouse messages are treated as client area mouse messages for the window that has captured the mouse.
HTH
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
If a man is standing in the middle of the forest speaking and there is no woman around to hear him...is he still wrong?
|
|
|
|