|
The first error indicates that you have two objects that contain the same function definition. The second is an error that is caused by not correclty linking to the .lib file for the dll that contains this function.
Hope this helps!!
|
|
|
|
|
For the First error try doing a complete "rebuild" this will delete the .obj files from your build directory and rebuild them. Sometimes this works.
|
|
|
|
|
Oh ouch... yuck...
Well, you'll have to do a bit of searching here. The LNK2005 indicates that you have more than one definition of ghWndMain. See the docs on LNK2005 for ideas. ghWndMain is declared in HOOK.C and should be extern to other modules. BTW sometimes you can use the FORCE switch to override this, but not a great idea.
But hey - maybe all of this stems from the fact that you are trying to use the C++ compiler to compile the WINCAP C sample - or at least integrate into your code(?). If you are not using MFC and stuff, you might be better off using C - if there are only C files in your project, you'll see much different results.
hmmm... might need an extern HINSTANCE ghInst; in dlgopen.c...
BTW with C++, you might also need to use extern "C" HANDLE var; in certain places instead of just extern HANDLE var; - this will turn off the name mangling and might help.
Maybe someone else has experience with this sample and using / porting it to C++.
|
|
|
|
|
HWND ghWndMain = 0
Is the above statement correct?
|
|
|
|
|
HWND ghWndMain = 0
Is the above statement correct?
|
|
|
|
|
#pragma data_seg("._WINCAP")<br />
HWND ghWndMain = 0;
#pragma data_seg()
Sure - but looks like 16 bit code with that pragma... not to worry, though, should compile...
But the wincap sample is pretty dated - old 16 bit code. There should also be a DIBAPI project or makefile - can you compile that? You'll need it.
I think what you're trying to do is use the WINCAP sample source directly in a cpp based project, and thats gonna be a bit of a hack. Even though you're getting close. I don't have WINCAP.EXE, so don't know exactly what you're up against, and it makes it tough to help.
|
|
|
|
|
hi Tim will it be okie if i sent you the whole project because i really dun know how to solve my problems. If it is okie i send it to you to your email account?
|
|
|
|
|
I need to enquire whether C complier can complier win32 api source code? If it does , will the resulting .exe ba able to be used in win98 as win98 is win32 ?
|
|
|
|
|
I encountered any 'funny' error on viewing the earlier error , i made one change to the code. The change is shown below :
#pragma data_seg("._WINCAP") //
HWND ghWndMain = 0 ; // Handle to main window -- used to post msgs
#pragma data_seg() //
IThe change is that i made the statement " HWND ghWndMain = 0 " a comment , therafter i was able to generate an exe . However when i click the exe i see this a windows which only show the background and no menu buttons can be seen.
|
|
|
|
|
I encountered any 'funny' error on viewing the earlier error , i made one change to the code. The change is shown below :
#pragma data_seg("._WINCAP") //
HWND ghWndMain = 0 ; // Handle to main window -- used to post msgs
#pragma data_seg() //
IThe change is that i made the statement " HWND ghWndMain = 0 " a comment , therafter i was able to generate an exe . However when i click the exe i see this a windows which only show the background and no menu buttons can be seen.
|
|
|
|
|
Here is my source code :
BOOL APIENTRY SavingDlgProc(HWND hDlg, UINT message, WPARAM wParam,
LPARAM lParam)
{
......
......
} \\ here is the error .
The complier shows the below error:
C:\msdn cd1\SAMPLES\MSDN\TECHART\asfasasfas\dialogs.cpp(293) : warning C4715: 'SavingDlgProc' : not all control paths return a value.
So what can be done to solve it?
|
|
|
|
|
Your explaination seems a little vaige but here are some ideas. First of all the warning C4715 indicates that you are not returning a value for at least one control path. This means you are not setting the return value in some logical case.
More than likley something like:
BOOL APIENTRY SavingDlgProc(HWND hDlg, UINT message, WPARAM wParam,
LPARAM lParam)
{
BOOL bRet;
if(something)
{
bRet = true;
return bRet;
}
else
{
//not setting bRet here as a return value
}
} \\ here is the error .
Since this is only a warning from the compiler I doubt its causing an error. I will however for arguments sake assume that when you state "here is the error". That you mean you are getting an error during debugging on the last line of this function. This line of code is were the function goes out of scope and cleans up anything allocated by this function. So I would guess that somewhere in this function you are overwritting something on the stack, that is currupting the computers memory stack. Check any NEW allocations!!
If you want more help with this please supply more info thanks!!
|
|
|
|
|
Hi,
I'm all out of ideas,
I want a lump of eye-candy for when my dialog app is downloading data etc,
Something more exciting than an AVI control,
But still logical and relevant, And most importantly its got to look really rad !
I want an idea not how to do it !
Any Ideas ???
Regardz
Colin Davies
|
|
|
|
|
What about an irregulat shaped dialog with picture background and then the AVI to indicate data movement
Happy programming!!
|
|
|
|
|
Hmm, I'm still trying to visualize your suggestion !
Regardz
Colin Davies
|
|
|
|
|
How about drawing a moving object using OpenGL?
|
|
|
|
|
How about embedding an mpeg player control in the dialog and showing two people doing "it".
Actually something more indicative of what the *user* will be doing, show an mpeg of a guy spanking his monkey...
|
|
|
|
|
"show an mpeg of a guy spanking his monkey..."
So you'd like to see a bloke 'tossing his caber' whilst the data is downloading. urrrrrhm.
|
|
|
|
|
I'm trying to integrate my C++ code to MFC, and am stuck
can you tell me what all I have to do "to transfer a stream of data into or out of a rich edit control"
I tried MFC help and am confused.
P.
|
|
|
|
|
> "to transfer a stream of data into or out of a rich edit control"
If you just need "plain text", you can use (CRichEditCtrl: GetWindowText(...) and (CRichEditCtrl: SetWindowText(...).
If you need to ge/putt RTF from the control, look into the CRichEditCtrl::StreamIn(...) and CRichEditCtrl::StreamOut(...) functions or the "EM_STREAMIN" and "EM_STREAMOUT" messages.
-=- James.
|
|
|
|
|
class A multiply inherits from class B and C.
Class B has function B::fn(int arg1).
Also, class C has function C::fn(int arg1, int arg2).
Which is correct way to use fn from A ?
|
|
|
|
|
easy - the function called is decided by the arguments provided. I assume class C's function has no default values ? If it did, you'd need to define where like this
C::fn(int arg1)
Christian
P.S. Chris, why am I not logged in ? ARGH !!!
|
|
|
|
|
Normally, a function hides a function with the same name in a base class. However, in this example where B and C are at the same level in the inheritance tree, any call to A::fn() is ambiguous, even though they have different parameter lists, because there are two fn's in the definition of A. Neither fn() hides the other.
You need to call them thus:
class B {public: void fn(int arg1) {} };
class C {public: void fn(int arg1, int arg2) {} };
class A : public B, public C {};
A objectA;
objectA.B::fn(1);
objectA.C::fn(2,3);
Wacky syntax there.
--Mike--
http://home.inreach.com/mdunn/
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
-- Buffy
|
|
|
|
|
which is better between the following two ?
(1) int i;
for(i=0; i<8; i++){ }
and
(2) for(int i=0; i<8; i++){ }
|
|
|
|
|
Well, to qoute an etseemed former colleauge, 'it depends'.
for(int i = 0; i < 19; i++) {
++i;
}
++i;
It's a question of scope basically, muddied by the fact that in the C++ standard the scope of i here should end with the '}' - but not all compilers support this yet. Stylistically, I like this form, and it follows the practise of declaring vars when you need them. Of course, form one allows you to reuse i in another loop on a conforming compiler.
|
|
|
|