|
Hi,
I'm trying to link a Visual C++ project after successfully compiling it.
The project is a PC-side application for PC-DSP communication. Thus, I use a provided library that I received
with the hardware.The project is a win32 application (not a console application)
When I try to link, I get these errors:
Linking...
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _free already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _malloc already defined in LIBCMTD.lib(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fclose already defined in LIBCMTD.lib(fclose.obj)
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library
Debug/PC_LVC.dll : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
PC_LVC.dll - 4 error(s), 1 warning(s)
Any suggestions?
Thanks,
Idan.
|
|
|
|
|
are you sure you inserted conditional inclusions ?
#ii !defined(__MY_HEADER_H_INCLUDED__)
#define __MY_HEADER_H_INCLUDED__
#endif //__MY_HEADER_H_INCLUDED__
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
|
Hi Idan,
It is really good to have a problem.
The possible reason could be, your hardware library might use different code generator(Multi threaded). To resolve this open your Project Setting, C/C++ Tab, check "Use run-time library" combobox. Try to change the threading model selected. I think, by default it could be a single threaded.. Change it to multithreaded..
If it doesn't workout let me know..
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
I need to keep the first column of my view hidden. so I created the column with size zero & used OnNotify to disable tracking. But now when I press “ctrl , + “ keys together the hidden column is shown. How to solve this problem?
Thanks..
sourabh
|
|
|
|
|
study.sourabh wrote:
I need to keep the first column of my view hidden
No offense, but this seems a weird design.
study.sourabh wrote:
How to solve this problem?
I think you will have to derive a class from the CListCtrl and handle the keyboardinputs in the ::PreTranslateMsg function (not call the base class if the key combination is ctrl, +
~RaGE();
|
|
|
|
|
It sounds like you need this column to store some values in it, and you don't want the user to see these values. It would probably be a better design to use the item data for each entry in the list view to store these information.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
I agree with Rage's "odd design" comment. Please elaborate on why you need this. Would it fit within your requirements to add the column to the right of all other columns instead, and then not provide a horizontal scroll bar? This would keep that column from being seen.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
hi..
ya i should have used the item data . but its difficult to change it now.
i cant put the hidden data in right side cos this column is used in find item .i was not able to use ant other column other than 0th one.
how can know i know "ctrl +" was pressed in OnNotify.
what is called after OnNotify? calling OnUpdate after "ctrl +" will solve the problem. is there any other solution ....
thanks
sourabh
-- modified at 6:53 Monday 29th August, 2005
|
|
|
|
|
hi...
as it will take more time to change the hidden column for the time being I am not changing it , will try to do it later.
I got a solution for the problem
A small change in the OnNotify will do it the sample code is
BOOL CMyView::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
HD_NOTIFY *pHDN=(HD_NOTIFY*)lParam;
if ( (pHDN->iItem == 0) && \
(pHDN->hdr.code == HDN_BEGINTRACK ||
pHDN->hdr.code == HDN_ITEMCHANGING )
)
{
*pResult = TRUE; // disable tracking
return TRUE;
}
return CListView::OnNotify(wParam, lParam, pResult);
}
OnNOtify can be used for disabling the tracking..
Thanks…
|
|
|
|
|
how we can get the caption of a button controls in a YESNOCANCEL messagebox dialog when the button controls get keyboard focus.
|
|
|
|
|
by testing the returning value...
otherwise, i'm not sure to understand well your question.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
i'm afraid you confused with my question. we can get the caption of button controls in a userdefined dialogs using ON_BN_SETFOCUS handler. but i want to get the keyboard focus of buttons in a Message box(save changes YES/NO/CANCEL) Modal dialog box.
|
|
|
|
|
pradeepvarghesek wrote:
how we can get the caption of a button controls in a YESNOCANCEL messagebox dialog when the button controls get keyboard focus.
You have to Use GetFoucs(...) api to retrieve the currently active Button and then using the GetWindowText(...) reterive the caption text!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
but where i will code in the case of MessageBox dialog.
|
|
|
|
|
You would have to come up with some sort of hook/monitoring application that knew when the message box is displayed. Doing that from within the same application that calls MessageBox() might be difficult as control does not return to that application until the dialog is dismissed.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
hiho@ll
you can start a new process with CreateProcess (or system,...)
i think everybody knows
my question:
(i think it will only work with creatprocess function)
how can i know if the process has really been started? (maybe the file has been deleted, or the app i want to start is single instance app and another instance is running, or the file has been damaged during download ,...)
how do i know what happend and if the process has been started or not, and if not, why not
thx@ll
|
|
|
|
|
your process should appear in the task manager...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
this means i have to check what processes are currently running
1. don't really know how i can check this, using my prog
2. what if it's a single instance app and i check the task manager
i will find the process, but it's not the process i wanted to start! it's another!
so how can i check if the process i wanted to start has been started?
thx
|
|
|
|
|
If CreateProcess returns TRUE, then the process was started.
If the program is a windowed application, you can use WaitforInputIdle to make sure it got a window up on the screen. A well-deisgned application that is only going ot allow a single instance to run would terminate before displaying any user interface. So if WaitForInputIdle times out, your other app is slow, or stopped. If you think it stopped, you can test the process handle to see if the handle is signaled - they are signaled if application is no longer running.
You can use the process identifier returned from the CreateProcess call and compare it with the results of a call to EnumProcesses to see if the process identifier is still present.
|
|
|
|
|
thx blake
seems simple
i'll check it out
|
|
|
|
|
Technicaly, the answer of toxcct is correct . But I suppose you want to check that in your code ?
I think one solution could be to use the handle of the process that is 'supplied' in the LPPROCESS_INFORMATION structure after CreateProcess is called. Then, with that handle, you can call GetExitCodeStatus and check if the lpExitCode == STILL_ACTIVE .
Hope this helps
|
|
|
|
|
thx
i'll check it
|
|
|
|
|
While you can use GetExitCodeThread() for this, a well-behaved application should not be concerned with what other threads are doing. By having threads communicate back and forth, you've effectively added an unnecessary level of complication to the application. The primary thread should create the other threads, give them a job to do, and then go off and do something else while not waiting around wondering about those threads. These other threads can then communicate back to the primary thread (e.g., PostMessage() ) as to what their status is.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
-- modifed at 13:45 Thursday 25th August, 2005
|
|
|
|
|
look into WaitForInputIdle()
|
|
|
|