|
many thx for your posts.
I've tried to switch to system:/console but I have this error:
error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
|
|
|
|
|
duta wrote: error LNK2019: unresolved external symbol _main...
So do you have a main() function?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
it's about a GUI using MFC.
I'm new in the field and I wish to learn. I need so see/write some variables but without using a label.
|
|
|
|
|
I find it. It's about TRACE()
I'm new and main problem is because I don't know how to use MSDN efficiently.
|
|
|
|
|
Dear Friends,
I need a progress bar which should have two values. Target and Actual. both values should be drawn on the same ctrl.
Like below
........Actual......[Target]
I already have used CMacProgressCtrl to display one value. Now i have to change it. can anybody help me out.
|
|
|
|
|
A very easy solution is to put a static control right above your progress control that indicates what 100% is. If you want to actually write on the progress control, however, you'll need to look at creating your own. Source code is plentiful, here for example.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello!
I have a Win32 application and I would like to retrieve the command line arguments passed to another application. I'm actually trying to get the command line arguments used to start each instance of svchost.exe.
Is there an API for this or do I have to implement a complex machanism? I thought of OpenProcess and different "query process information" functions after that but I could not find any solution... Can anyone help?
Thanks in advance!
|
|
|
|
|
Here is one example.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Getting these compile errors
Linking...
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _free already defined in libc.lib(free.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _malloc already defined in libc.lib(malloc.obj)
I typed in NODEFAULTLIB:library
based on this warning
defaultlib "MSVCRTD" conflicts with use of other libs; use /NODEFAULTLIB:library
but it didnt resolve the problem.
thanks,
sb
|
|
|
|
|
Did you try google[^] ? There's a lot of similar questions...
Check also MSDN[^] (although it might be a bit different).
|
|
|
|
|
I suspect it's because free() and malloc() are already defined in libc.lib...
|
|
|
|
|
Hi,
i have got the following questin:
I have a SDI Project with a RichTextControl and an editbox in the toolbar.
I want to pass the value in the editboc(user input) to a funktion in the document.cpp.
I want to load some data in the document and then i want to update te view with this datas.
I know how to update the view with datas coming fram the document, but i don't know the right way to pass a value from the editbox in my toolbar to the document !!!???
Here is some code :
BOOL NEW_cToolBar::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_KEYDOWN && VK_RETURN == pMsg->wParam)
{
return TRUE;
}
else if (pMsg->message == WM_KEYUP && VK_RETURN == pMsg->wParam)
{
CString chrBuf;
m_Ctrl_EDIT.GetWindowText(chrBuf);
return TRUE;
}
return false;
}
void CApplicationView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
CTheReaderDoc *pDoc = GetDocument ();
CRichEditCtrl &rCtrl = GetRichEditCtrl();
rCtrl.SetWindowText (pDoc->m_cstrAusgabe);
rCtrl.SetFont(pDoc->m_ptrFont);
rCtrl.SetModify(TRUE);
}
Or is it better to pass the Value directly to the View without using a document ?
And when yes, how can I do that ?
Please help me !
Many thanx
Croc
|
|
|
|
|
You have loads of ways to do this, really, depending on your application.
What it looks like you should do is have a function in your document, eg:?
BOOL CMyDoc::UpdateSomeTextField (CString s)
{
if ( !some validation here )
return FALSE;
m_KeepString = s;
UpdateAllViews (NULL);
return TRUE;
}
and in your PreTranslateMessage function, call this member function. This will decouple your document from the toolbar, and remove the view from the equation.
Also, CFrameWnd has a function GetActiveDocument which will be a bit safer for you - and may make it easier when you move to an MDI model (if you choose).
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
Hi Mr.Clarke,
thank you very much for your reply.
I added this to the document.h:
.
.
.
.
public:
CString m_KeepString;
public:
BOOL bUpdatetextField(CString);
And this in the document.cpp:
BOOL CDocumentDoc::bUpdatetextField(CString s)
{
m_KeepString = s;
UpdateAllViews(NULL);
return TRUE;
}
But how can I call the bUpdatetextFiled from my toolbar :
BOOL New_cToolBar::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_KEYDOWN && VK_RETURN == pMsg->wParam)
{
return TRUE;
}
else if (pMsg->message == WM_KEYUP && VK_RETURN == pMsg->wParam)
{
????????? function call ???????????
return TRUE;
}
return false;
}
Many many thx
best regards croc
|
|
|
|
|
Hi ;
is there really no hope
best regards
CrocodileBuck
|
|
|
|
|
Err, some of us go home, and have a life...
Try:
CMainFrame *pMF = STATIC_DOWNCAST(CMainFrame, AfxGetMainFrame ());
CMyDoc *pDoc = STATIC_DOWNCAST(CMyDoc, pMF->GetActiveDocument ());
pDoc->UpdateMyField (s);
And check the debugger as you go, as this is from memory.
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
Hi Mr.Clarke,
>> Err, some of us go home, and have a life...
L*O*L yeah that's absolutely corect
Many, many, many thanx, now it will work ...
Thanx for your great help
very best regards
Croc
P.S.: Instead of AfxGetMainFrame() i have to use AfxGetMainWnd()
|
|
|
|
|
I have written a program that enumetares a USB devices connected to a PC and obtains all the interface strings. I am using SetupDI APIs
I compile the program on PC1 and everything works fine.
When I copy the executable of my program [along with all files in release dir] to a different PC, say PC2 and execute it, the program does not return any USB interface strings.
But when I compile my program on the PC2 and run it, I get all the USB interface strings
Why does this happen?
The configurations of both the PCs are same.
|
|
|
|
|
|
How so, Mike? It sounds as though the second machine indeed has Visual Studio on it.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Just a wild guess, I really had no concrete ideas from reading his post. Should I not have done that?
led mike
|
|
|
|
|
More often than not, the answer to "Why won't my VC++ application run on a machine other than the one it was compiled on?" is either the reason you stated, or the application was mistakingly compiled in debug mode. However, he indicated that both machines had VS installed. I'm still baffled.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: he indicated that both machines had VS installed.
Not all installations of VS are equal, for example a Platform SDK difference. No reason to be baffled given the lack of information we have, this thread calls for a
led mike
|
|
|
|
|
led mike wrote: Not all installations of VS are equal, for example a Platform SDK difference.
But didn't the code compile fine on both machines? If the code was using something specific to the SDK or the DDK, and one of the machines did not have that, I would expect a compile error, not a run-time error.
led mike wrote: ...given the lack of information we have...
Agreed.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Dear all
I have a set up for a multithread application that works with Sound Card and it uses Socket Connection. this set up works perfectly on a computer with these specifications:
motherboard: ASUS P4P800-MX Model
Processor: Intel Celeron CPU 2.53GHz
Memory: 512 MB , GEL brand
Hard Disk: 80GB Maxtor , IDE
Sound Card: Creative Sound Blaster 24 bit
but when mentioned setup run on another computer , this application occur many different exceptions e.g. some times some Icones hide or access violation.
second computer specifications:
Motherboard: ASUS P5GC-MX/1333 Model
processor: Intel Pentium D 2.8GHz Dual-Core Processor
Memory: 512 MB , Kingstone brand
Hard Disk: 80GB Maxtor, SATA
Sound Card: Creative Sound Blaster 24 bit
I was changed OS, RAM ,Motherboard BIOS , Power supply, Sound Card and used another VGA ... but the problems remain.
the application wrote with Delphi7 .
any body have suggestion?
|
|
|
|