|
Are you using STL?
For STL you would do:
vector<string> combovectorwrite(vector<string>& values, int val_num)
{
vector<string> resultantVector;
return resultantVector;
}
Is that what you were looking for?
-Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
thanks. for some reason, i had something similar to that but it didnt work.
|
|
|
|
|
I built a simple Win32 program but it gives me the following message...I'm not sure what's wrong. I did the same program before and it worked, now something went wrong.
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/Program_1.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Program_1.exe - 2 error(s), 0 warning(s)
|
|
|
|
|
try this : http://www.cryer.co.uk/brian/mswinswdev/msdev_lnk2001ueswm.htm
also, did you create an empty, win32 console application when you created the project?
|
|
|
|
|
Check the libraries you added to your project. You might have made a mistake while adding one.
|
|
|
|
|
check the link property sheet in the Project settings dialog box,
to see if something go wrong with the /subsystem: option.
Just a try. May u good luck.
|
|
|
|
|
I succefully compiled a small program in VC++. However, when I built the final edition in release mode, it doesn't work properly. When I run the stand alone .exe program, it pops up for a split second and then vanishes off my desktop screen. It's a consoloe application. Why might this be happening?
Thanks
|
|
|
|
|
The console closes itself when it has finished its job.
Put a "getc()" command at the end of your program to wait for
a user input before closing the application.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I tried to use the "getc()" but kept getting all kinds of error messages, I'm not sure hoe to implement it? Starnge thing is that I';ve made console programs before and I've not had this program, eg. the following program should ask me to press any key before ending the program...
#include <iostream>
using namespace std;
int main()
{
cout
<<"hello World!"<
|
|
|
|
|
Maybe VC++ keeps the window open until you, the user or programmer, close it.
Try right-clicking on your built .exe and chose to edit the properties. Make
sure that on the program tab "Close at end of execution" (or sth. like that... I don't know the real English expression -- I've got a German Win version) is NOT checked. You can also test your program in the console. If it works properly in there, this should just be one of Win's .. well... failures.
|
|
|
|
|
pf7 is correct. if a program is complete, if you just run the executable, the program will close itself. however, VS.net forces the progeram window to remain open until you close it (press any key to continue...)
you can add
_getch();
to your program, i beleive you need #include <conio.h> to use it. put _getch() at the end of the program to force a key press before th window closes.
|
|
|
|
|
Well my answer may be stupid. Excuse me because I am a beginner but try putting this at the end of your code before the "return":
int a;
cin >> a;
Your program wont close until the user presses "enter".
|
|
|
|
|
CString strFileDirs = "dirs.data";<br />
char szBuf[_MAX_PATH];<br />
<br />
TRY {<br />
CStdioFile fileDirs(strFileDirs, CFile::modeRead);<br />
while(fileDirs.ReadString(szBuf, _MAX_PATH)){<br />
ULONGLONG dwSavedPos = 0;<br />
dwSavedPos = fileDirs.GetPosition();<br />
<br />
TRACE("seek: %u\n", dwSavedPos);
fileDirs.SeekToBegin();<br />
fileDirs.Seek(dwSavedPos, CFile::begin);
}<br />
fileDirs.Close();<br />
}<br />
CATCH (CFileException, pE) {<br />
pE->ReportError(MB_ICONSTOP, IDS_FILE_ERROR);<br />
}<br />
END_CATCH<br />
What I'm doing wrong?
|
|
|
|
|
Use TRACE("seek: %I64u\n", dwSavedPos) instead.
|
|
|
|
|
|
What about:
DWORD dwSavedPos = fileDirs.GetPosition();<br />
TRACE("seek: %lu\n", dwSavedPos);
|
|
|
|
|
and compiler warns about bad type conversion.
My system is default Win2000 and VS .NET installation.
And I dont use any external include dirs all is just from default install.
|
|
|
|
|
Ok, my bad. It wasn't until I read the VS .NET documentation that I see that CFile::GetPosition() indeed returns a ULONGLONG. I'm at a loss for what to try next as I do not use VS .NET and am not familar with all the differences between VS v6.
|
|
|
|
|
could somebody explain why the nPos parameter wraps at 32767
void CMyDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
olle
|
|
|
|
|
|
See if MSDN article Q152252 is of any help.
|
|
|
|
|
it works, thanks
olle
|
|
|
|
|
(more of a curiousity question than anything)
I've seen both this:
SHELLEXECUTEINFO sei = {0};
and this:
SHELLEXECUTEINFO sei;
memset(&sei, 0, sizeof(sei));
and even: (but this is Win32 specific I think)
SHELLEXECUTEINFO sei;
::ZeroMemory(&sei, sizeof(sei));
Which is "better"? Is there *really* any difference?
Personally, I've always used the first one, but I've seen many people using the second one, and was wondering if I should switch over.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
[Rich Cook]
|
|
|
|
|
I would have thought the first two would be the same and they nearly are. Under VS.NET 2003, however, with the first, the compiler first stores a 0 at the first DWORD then does a stosd for the remaining while memset does a stosd for the entire structure. The result is a very slight, but measurable, performance penalty for the first. Don't know why it's being so dumb but there you are.
ZeroMemory just uses memset. (I believe it's a macro.) It was for use when NT actually ran on non-Intel processors.
|
|
|
|
|
Thanks!
I figured ZeroMemory and memset were basically the same.
Weird that = {0} works different on VS.NET. I'm still using VC6, so that doesn't affect me now.
Joe Woodbury wrote:
stosd
wtf?
I prefer to wear gloves when using it, but that's merely a matter of personal hygiene
[Roger Wright on VB]
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
[Rich Cook]
|
|
|
|