|
I am trying to pass a vector to a function, but something is wrong.
I think I am declairing the prototype and function incorrectly
this is what I have
in my *.h file
int static parseData(vector<double> v);
in my *.cpp file
<br />
RFMAccess::someFunction(){<br />
<br />
\\do some stuff here and pass the vector<br />
parseData(data);<br />
}<br />
<br />
<br />
int RFMAccess::parseData(vector<double> v){<br />
<br />
\\do some stuff with the vector here<br />
<br />
return 0;<br />
}<br />
I actually need to pass the vector to another function in another class, but this is the idea I am trying to do.
I would pass-by-reference but, as mentioned the function is in another class.
thanks,
Steven
|
|
|
|
|
vector is not a type, it is a template.
|
|
|
|
|
I didn't realize that the code left off the <double>
The function looked more like
RFMAccess::parseData(vector<double> v)
does this look corret?
steven
|
|
|
|
|
I think you meant to do something like
RFMAccess::parseData(vector<int>& v)
|
|
|
|
|
or
RFMAccess::parseData(const vector<int>& v)
|
|
|
|
|
I tried 2x to get the greater than and less than symbols in the message but they kept getting left off.
I just realized that they were at the bottom
RFMAccess::parseData(vector<int> &v)
is this the correct notation?
steven
|
|
|
|
|
I understood that. What I was implying is that you might want to pass your vector by reference(or constant reference). You might not want to create a copy of the array/vector every time you call the function(unless it was your intent;)).
|
|
|
|
|
|
I didn't realize that the code left off the <double>
The function looked more like
RFMAccess::parseData(vector<double> v)
does this look corret?
steven
|
|
|
|
|
I got my hands on a Xerox copy of some notes, which says that AfxWinTerm() is called *after* ExitInstance() in an MFC application.
MSDN doesn't even have an entry for AfxWinTerm() . MSDN search and Google weren't very helpful.
I'm beginning to suspect these notes I have are very old and refer to outdated content. Am I right?
Vikram.
-----------------------------
KI klike KDE kand kuse kit, kbut KI kmust kadmit, kstarting kall knames kwith K kis ksilly. KI khope kthey kwill kgive kup kthis kwhole kscheme ksoon kand kcome kup kwith kreal knames.
pI vThink aHungarian nNotation vIs iA aWonderful nThing cAnd pEveryone avShould vUse pIt aAll dThe nTime, adNo nMatter pWhat dThe nContext, adEven adWhen vSpeaking.
|
|
|
|
|
Was just poking around CP and found this article..
http://www.codeproject.com/cpp/mfcprogflow.asp
Quote from the article..
Once WM_QUIT is received Run returns and control returns to AfxWinMain which performs clean-up and lastly calls AfxWinTerm which deletes all the global application structures that were created.
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
I wanted to know how Could i Send email in an Visual C++ App. Is there any API to do that ?
|
|
|
|
|
Several. Look at:
CDocument::OnFileSendMail()
(Extended) MAPI
SMTP
CDO
|
|
|
|
|
|
|
Hi All,
I would like to iterate through every item in a list control and change each item's icon based on a time criteria. I have tried GetItem() but I haven't been able to use it correctly (the documentation is very vague) as I only get an empty structure back even though I put the index I am after in iItem. Could someone please help me out here?
Cheers,
Clint
|
|
|
|
|
Before calling GetItem(), you need to set the mask member of your structure with the flags (or'ed together) for the element values that you want to retrieve.
struct LVITEM sItem;
sItem.mask = LVIF_IMAGE | LVIF_PARAM | ... whatever else you want...
m_oMyListCtrl.GetItem(&sItem);
onwards and upwards...
|
|
|
|
|
Guys,
How can I get text info into the systray? Something like the clock. All the examples I see are to put icons there but I need to put a small amount of text there (and it would be great if I could change the color of it too - maybe even make it scroll.)
Thanks!
|
|
|
|
|
There's no support for this in the API. If your text can fit on a 16x16 icon, then you can create an icon dynamically with the text on it. Otherwise, you'll have to be extremely creative, possibly finding the system tray window, and creating a child window inside it. It's not that simple either. You might even have to subclass the taskbar so that you can stop the taskbar's default tray positioning, which means writing a DLL and using either SHLoadInProc() or a system-wide hook to get into explorer's address space...
If you manage it, write an article . You might want to find another way of showing the information though. It's probably not worth the effort of reprogramming Windows.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Hi all,
I have an an application that is a Popup Dialog box in a dll. I'm using MFC 6.0.
my problem is I'm trying to load a menu bar icon on the sucker, and I just can't get it to load. I thought I do this:
SetIcon(::LoadIcon(NULL,MAKEINTRESOURCE(IDR_MAINFRAME)),FALSE);
in the OnCreate Overrideable in my CDialog-derived class. Doesn't work though. It always returns 0x000000 for the HICON.
any suggestions on how to do this? I'm sure I'm just putting it in the wrong place or performing the operation wrong.
Any insight, comments or suggestions are greatly appreciated.
Thanks!
|
|
|
|
|
in debug(watch) window enter the following
"@err, hr"
What is the value of that expression after the line above is executed?
|
|
|
|
|
As it turns out,
when using the LoadIcon you must get the HINSTANCE of the dialog in the dll, not the application HINSTANCE. That fixed my problem.
thanks for the help though!
|
|
|
|
|
Hey my name is Renaud and I have a serious DirectX related problem… any help??
I build this full screen menu with directX...This Directx menu can cycle through various DirectX games and launch each one. When the user selects the game he wants to play the menu application clears out all the surfaces and then launches the new direct x game and then closes the menu app.
The problem is the same game cannot be played twice thought the menu without getting a DirectDraw error ... I believe the error is created while the game is trying to SetCooperativeLevel... so you can launch the game through the menu the first time, but the second time it crashes...weird eh?
I am completely clueless on how to fix this.
well anyway any feedback would be greatly appreciated!!
Thanks
Renaud Richard
|
|
|
|
|
What version of the DirectX interfaces are you using? Since you mention DirectDraw, I'm guessing DX7.
What is the HRESULT return code from the call to SetCooperativeLevel() , and what flags are you passing to the dwFlags parameter?
- Mike
|
|
|
|
|
Hello,
I need to enable/disable secondary monitor from my program.
I found out how to get information about monitors, but nothing about how I can automatically extend desktop to the monitor or undo such action.
I need to enable/disable my secnodary monitor time to time, and I could not find a FREE program which would do it for me, so I want to write my own.
Thanks.
Regards, Alexander.
|
|
|
|