|
Franken wrote: Now it works somehow.
This is usually a good indication that the problem still exists and has simply been masked or moved to a new location.
Franken wrote: The runtime error only occur if I try to place this code in the worker thread,
Which makes sense as worker threads shouldn't be accessing such information. See these two articles for more on threads and how they are supposed to communicate back and forth with the primary thread.
http://www.flounder.com/workerthreads.htm
http://www.flounder.com/uithreads.htm
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hi All,
Can you guys please help me resolving this error?
Thanks in advance
Preeti9
|
|
|
|
|
You've not provided enough information. See here for possibilities.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Sorry for not providing enough info...
Here are the errors listed:
[code]
Linking...
MSVCRT.lib(MSVCRT.dll) : error LNK2005: __vsnprintf already defined in LIBCMT.lib(vsnprint.obj)
MSVCRT.lib(MSVCRT.dll) : warning LNK4006: __vsnprintf already defined in LIBCMT.lib(vsnprint.obj); second definition ignored
Creating library ReleaseMinSize/WosaIDC.lib and object ReleaseMinSize/WosaIDC.exp
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library
CardReaderDev.obj : error LNK2001: unresolved external symbol _WFSClose@4
CardReaderDev.obj : error LNK2001: unresolved external symbol _WFSDeregister@12
CardReaderDev.obj : error LNK2001: unresolved external symbol _WFMSetTimer@16
CardReaderEvent.obj : error LNK2001: unresolved external symbol _WFMSetTimer@16
CardReaderOper.obj : error LNK2001: unresolved external symbol _WFMSetTimer@16
CardReaderDev.obj : error LNK2001: unresolved external symbol _WFSRegister@12
CardReaderDev.obj : error LNK2001: unresolved external symbol _WFMSetTraceLevel@8
CardReaderDev.obj : error LNK2001: unresolved external symbol _WFSOpen@36
CardReaderDev.obj : error LNK2001: unresolved external symbol _WFMKillTimer@4
CardReaderEvent.obj : error LNK2001: unresolved external symbol _WFMKillTimer@4
CardReaderOper.obj : error LNK2001: unresolved external symbol _WFMKillTimer@4
CardReaderDev.obj : error LNK2001: unresolved external symbol _WFSFreeResult@4
CardReaderEvent.obj : error LNK2001: unresolved external symbol _WFSFreeResult@4
CardReaderOper.obj : error LNK2001: unresolved external symbol _WFSFreeResult@4
CardReaderDev.obj : error LNK2001: unresolved external symbol _WFSExecute@20
CardReaderDev.obj : error LNK2001: unresolved external symbol _WFSGetInfo@20
CardReaderOper.obj : error LNK2001: unresolved external symbol _WFSCancelAsyncRequest@8
CardReaderOper.obj : error LNK2001: unresolved external symbol _WFSAsyncExecute@24
CardReaderReg.obj : error LNK2001: unresolved external symbol _WFMCloseKey@4
CardReaderReg.obj : error LNK2001: unresolved external symbol _WFMQueryValue@16
CardReaderReg.obj : error LNK2001: unresolved external symbol _WFMSetValue@16
CardReaderReg.obj : error LNK2001: unresolved external symbol _WFMCreateKey@16
CardReaderReg.obj : error LNK2001: unresolved external symbol _WFMOpenKey@12
LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
ReleaseMinSize/WosaIDC.dll : fatal error LNK1120: 18 unresolved externals
Error executing link.exe.
WosaIDC.dll - 26 error(s), 2 warning(s)
[\code]
I have included all the lib files also..But still I am getting 26 errors.
Thanks again
Preeti9
|
|
|
|
|
Dear u!
do you use Visual C++ 6.0?
you set again Option setting.
Project/Setting/ Link ..
I Hope that is useful to you!
Best regards.
-- modified at 0:56 Wednesday 16th November, 2005
|
|
|
|
|
|
Hi,
I have two objects, both point to each other in OO.
e.g.
Class Father
{
private int id; //id of father
private Son son;
}
Class Son
{
private int id; //id of Son
private Father father;
}
so I need to have two tables in database as follow,
Table Father :
(id, SonId)
Table Son :
(id, FatherId)
The problem is, should I eliminate the one of the reference in one of the table, e.g.
Table Father :
(id)
Table Son :
(id, FatherId)
so I just have the fatherID in the son table.
But if I remove the sonID from the father table,
I need to join the two tables when I retrieve fathers
from the father table.
So what are the pros and cons of the two schema design ?
Thanks
|
|
|
|
|
If you keep the references in both the tables, you can improve the efficiency by eliminating joins. You can find all 'children' of a 'father' and vice versa by a simple query on a single table.
The down side however is an additional overhead in maintaining the redundant data consistently. You need to make sure to update the respective fields whenever any child is to be deleted or the other way. Just see what is preferable for your application, efficiency or simplicity...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
I am trying that my program does some task before calling MFC class:
#include <afxwin.h>
class MFC_Window :public CFrameWnd
{
public:
MFC_Window()
{
Create(NULL,_T("whatever"));
}
};
class MyApp :public CWinApp
{
MFC_Window *wnd;
public:
BOOL InitInstance()
{
wnd = new MFC_Window();
m_pMainWnd = wnd;
m_pMainWnd->ShowWindow(1);
return 1;
}
};
int main ()
{
// some tasks...
if (some tasks == true) MyApp theApp;
}
Calling MFC from main() does not work. Does anybody know how to do this? Or how to put the MFC as not visible?
Thanks,
Christian
|
|
|
|
|
Just for clarity, MFC is not a class nor is it callable.
What exactly is it that you are wanting to do prior to displaying any sort of window?
Deriving from CFrameWnd indicates that you are working on an application. Thus you'll not be able to use main() .
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
If I understand u correctly u want to do things before showing the main window.
To do this u don't have to mangle with main(), WinMain() nor constructing MyApp yourself. All u have to do is put some code in MyApp::InitInstance() before the window creation/show.
Just to comment few other things:
First, the way u try to initialize MyApp is invalid syntax.
If u follow the MFC App Wizard, MyApp is created on the "global stack" - the standard library initializes it before calling main().
Second, u can track down MFC's WinMain (just look at the call stack) and alter it. But your code will not run there unless u compile MFC itself.
HTH
|
|
|
|
|
Thank you for your replies.
Yes, what I am trying to do is to do things before showing the main window, or not to show it at all. My programm enumerates NFC boards, and if it detects more than 1, a window should pop up and ask user to select one of them. If it only finds one board, the app should select that board and the window shouldnt pop up.
I tried to set the visible property to false, but nothing happened!?!? The only thing I can imagine is that the release build wont show the window, I dont know and didnt try it.
Thanks
|
|
|
|
|
Hi everybody,
I'am using the DrawText function to draw this text "p&m":
DrawText(_T("p&m"),LPRECT(CRect(0,0,100,100)),DT_LEFT);
but my problem is that the text on the screen appear with the 'm' underlined.
could someone help me!!
thanks.
|
|
|
|
|
Either double the & character, or use the DT_NOPREFIX flag (i.e. specify DT_LEFT | DT_NOPREFIX ).
This feature is intended for use by various Windows functions to indicate accelerator keys for activating controls. Windows 2000 and higher, by default, hide the accelerator key indicators until the Alt key is pressed, so you may not have seen this behaviour.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
What you are experiencing is windows' method of representing shortcuts. So what you have to do in order to get the text "p&m" is to use the folowing ampersand escape sequence:
DrawText(_T("p&&m"), LPRECT(CRect(0,0,100,100)), DT_LEFT);
For more details look up escape characters on msdn
|
|
|
|
|
DrawText(_T("Thank you Mike && mikanu for your help"), LPRECT(CRect(0,0,100,100)), DT_LEFT | DT_NOPREFIX)
|
|
|
|
|
In Visual Studio 6, is it possible to enable breakpoints only for a certain thread? It is little annoying when the debugging context suddenly changes to another thread.
If it is not possible in Visual Studio 6, is it possible atleast in WinDbg?
thanks!
|
|
|
|
|
You can put conditions on breakpoints. If you have a variable that represents the active thread, you could use that.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I attempted to use WMF SDK, but ran into link error.
DRMShow.cpp
Generating Code...
Linking...
WMStubDRM_38503.lib(so3.obj) : error LNK2001: unresolved external symbol __ftol2
WMStubDRM_38503.lib(rc4safe.obj) : error LNK2001: unresolved external symbol __SEH_epilog
WMStubDRM_38503.lib(cpu.obj) : error LNK2001: unresolved external symbol __SEH_epilog
WMStubDRM_38503.lib(rc4safe.obj) : error LNK2001: unresolved external symbol __SEH_prolog
WMStubDRM_38503.lib(cpu.obj) : error LNK2001: unresolved external symbol __SEH_prolog
Debug/DRMShow.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
Yong
|
|
|
|
|
yongwpi wrote: WMStubDRM_38503.lib(rc4safe.obj) : error LNK2001: unresolved external symbol __SEH_epilog
WMStubDRM_38503.lib(cpu.obj) : error LNK2001: unresolved external symbol __SEH_epilog
WMStubDRM_38503.lib(rc4safe.obj) : error LNK2001: unresolved external symbol __SEH_prolog
WMStubDRM_38503.lib(cpu.obj) : error LNK2001: unresolved external symbol __SEH_prolog
Doesn't this require linking with sehprolg.obj ?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Are you using VC6? If so, you're SOL. MS stopped releasing VC6-compatible LIBs a couple years ago.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | NEW~! CP SearchBar v3.0 | C++ Forum FAQ
"Linux is good. It can do no wrong. It is open source so must be right. It has penguins. I want to eat your brain."
-- Paul Watson, Linux Zombie
|
|
|
|
|
many functions require parameters of type HANDLE. how to get it? take the following for instance:
CEdit *pEdit;
pEdit = new CEdit();
pEdit->Create(0,rect,this,IDC_EDIT1);
...
delete pEdit;
Thank you very much!!!
-------------------
I am learning C++ and English
|
|
|
|
|
ewighell wrote: // how can I get a handle to the Edit window?
Use the GetSafeHwnd() method. However, why do you need it?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I want to send a message with the function SendMessage(), it seems that some of its parameters are of type HWND.
I want to send a BN_CLICKED message to the button m_bn1, which is of type CButton with the following code, but it seems does not work, where am I wrong?
SendMessage(BN_CLICKED,IDC_BUTTON1,(LPARAM)m_bn1.GetSafeHwnd());
Thank you very much!!!
-------------------
I am learning C++ and English
-- modified at 21:47 Tuesday 15th November, 2005
|
|
|
|
|
First, you don't need to get the HWND. You can just call pEdit->SendMessage(msg, wparam, lparam).
But, it won't work in your case. BN_CLICKED is a notification send by the button to its parent, not the other way aroiund . And it's not a BN_CLICKED message, it's a WM_COMMAND message with BN_CLICKED encoded in its WPARAM parameter (see MSDN for details).
What do you want to accomplish?
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|