|
I just tried to build a simple program like Hello.cpp by using Visual C++. NET but I got errors for Linking problem. Anyone has any idea how to set it up correctly?
|
|
|
|
|
What kind of liking problems did you get?
// Afterall, I realized that even my comment lines have bugs
If the sun were to blow up, it would take us 7-8 minutes to realize it.
|
|
|
|
|
When i pressed build and it gave me this error
error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup
fatal error LNK1120: 1 unresolved externals
this is my code
#include <iostream>
using std::cout;
using std::endl;
int main()
{
cout << "Hello" << endl;
return 0;
}
|
|
|
|
|
This link error is occuring because your compiler/linker settings are expecting WinMain(...) as the entry function, not main(). This occurred when creating the project.
You can get the above code to compile by manually setting the compiler/linker settings:
- Make sure your "Solution Explorer is visible" ( View | Solution Explorer)
- Right click on project (**not the solution**) node in Solution Explorer tree view and select properties
- Click on C/C++ | Preprocessor. On the right hand side you will see "Preproccesor Definitions".
- Replace _WINDOWS with _CONSOLE (NOTE the underscore)
- Now, click on Linker | System. Click on the "Subsystem" on the right. Once the Subsystem line is active and drop down arrow appears to the far right. Click on that and you will see a list of choices. You want to change the "Windows (/SUBSYSTEM:WINDOWS)" to "Console (/SUBSYSTEM:CONSOLE)".
- Compile. Should work. Now "int main()" is the expected entry function.
The above can all be avoided by selecting a "Win32 Console Project" instead of a "Win32 Project" when you create a new project.
And by the way, I am assuming your iostream header was included and was clipped from your code above because the "< >" was treated as an HTML tag in the post.
Mike
|
|
|
|
|
Thanks Mike...i solved my problems by choosing Console Project.
|
|
|
|
|
Hi!
I am looking for a C++ compiler for AMD64 platform, preferrably a free version!
Does GNU GCC work for me? They do not explicitly say that it produce AMD x86-64 code!
Thanks in advance!
Rob
|
|
|
|
|
Yes.
gcc -m64
Maxwell Chen
|
|
|
|
|
My app uses an old style MFC File open dialog box.
I noticed that in Microsoft Word - File Open dialog box, if you click the drop down box for the "Look in" field at the top, there is an option at the bottom that says FTP Locations.
One can use this option to open files from a remote location via FTP directly into MS Word.
I need this ability in my app but I can't figure out how. I have looked through the MFC documentation and I can't find squat!
Any help appreciated.
George W
Software Developer
www.zsystems.ca
|
|
|
|
|
|
Hi,
I am creating a CListCtrl component, with the style "owner draw fixed" on. I'm catching the WM_CONTEXTMENU message in order to recognize right-click on the list control, and then I use HitTest
function to look if the mouse is on one of the items.
I find that I get return value 0 even if my mouse is on the header
row. I use ScreenToClient function previous to calling HitTest.
How can I recognize that I'm on the header row ?
Many many thanks in advance to anyone of who has an idea.
g_sol_1
|
|
|
|
|
Before doing the HiTest call, can you do a WindowFromPoint() and see whether it returns the GetHeaderCtrl() CWnd* pointer or the CLIstCtrl pointer, as the header should be a different child window of the main control.
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
Thanks Roger for your prompt reply !
Your solution works great, but I'm trying also different approach
to my problem, here is another question in this area:
Is it possible to catch the ContextMenu event when it is fired from the header control so it will not pass on to the list control ?
If you or anyone else knows the answer and has some time to reply, It will be great.
Thanks again, Gidi Gal
|
|
|
|
|
This function is not being nice to me! Here's what I have:
KeyInfo.h:
class CKeyInfo : public CObject
{
public:
CKeyInfo() {}
virtual ~CKeyInfo() {}
DECLARE_SERIAL(CKeyInfo)
virtual void Serialize( CArchive &ar );
};
KeyInfo.cpp:
IMPLEMENT_SERIAL(CKeyInfo, CObject, 1)
void CKeyInfo::Serialize( CArchive &ar )
{
CObject::Serialize(ar);
if (ar.IsStoring())
{
}
else
{
}
}
MyDoc.h:
class CMyDoc : public CDocument
{
...
private:
CArray<CKeyInfo *, CKeyInfo *> m_arrKeyNames;
};
MyDoc.cpp:
void CMyDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
}
else
{
}
m_arrKeyNames.Serialize(ar);
}
I've tried placing this function in several places, all to no avail. I've also tried it with several different signatures (e.g., Internet examples, MSDN). It never gets called. The default implementation (in afxtempl.h) does, though.
template <>
void AFXAPI SerializeElements <CKeyInfo> ( CArchive &ar, CKeyInfo *pKeyInfo, int nCount )
{
for (int x = 0; x < nCount; x++, pKeyInfo++)
pKeyInfo->Serialize(ar);
}
Anyone see what I might be doing wrong?
Thanks,
DC
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
hey,
what do i have to do to run my process in the LocalSystem Contex ?
Thanks in advance!
|
|
|
|
|
Hi,
I want to retrieve the CONNECTED computer names of a network. I want to avoid giving users the ability to submit their own 'server string', therefore i want to somehow retrieve the computer names of a network and place them in a tree view. It should look the same as, for example, the Window Explorer, only you won't be able to 'go deeper' into the hierachy (like folders etc.). I hope you understand what i'm trying to say......anyway....all help is appriciated.
Many thanks,
Abebe
Er zit een korstje op mijn aars.
|
|
|
|
|
I think you are looking for WNetOpenEnum() and WNetEnumResource() .
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Thanks! I checked those methods out earlier, but i kept getting mapped network drives and other stuff. I didn't check the 'scope' argument properly.
Thanks again.
Er zit een korstje op mijn aars.
|
|
|
|
|
Help! I'm working on a project that involves capturing fingerprints and encoding them as PDF 417 barcodes on a cheque. Can anyone provide an mfc style api that reads and prints barcodes in this format?
I'll appreciate if it's free Pls.
|
|
|
|
|
There are some articles on printing / drawing barcodes here:
Bar code aritlces[^]
Not sure about reading them, look like you will need to get hold of seom hadrdware that can scan barcodes, usually they just convert it to the equivalent keyboard key presses.
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
Thanks Roger.
I've seen the article u suggested. It doesn't cater for PDF 417 barcodes.
Please any further help will be appreciated!
What will life be without politicians and programmers?
|
|
|
|
|
I've found many good samples about DataGrid, but I'm a freshman & couldn't understand them completely.
I need a good sample that demonstrates how to link DataGrid Component to my database. I mean how to fill DataGrid's column by data from my database.
If anyone can help me please e-mail it:
keeper_@km.ru
Thanks in advance.
|
|
|
|
|
|
Hello,
Does anybody know how to cast a IXMLDocument object into a VARIANT type object?
Thenks a lot
|
|
|
|
|
|
Thanx a lot for the Info. How do I do the first part of 'Query IXMLDocument for IDispatch'?
|
|
|
|