|
Figured it out. I needed to have
#include "afxres.rc"
in my resource includes. Even though this gets put there automatically by AppWizard in an MFC app, it does NOT get put there automatically when you have a console app, even if you check "An app that supports MFC".
Guess that's what I get for relying too heavily on generated code.
Even if you win the rat race, you're still a rat.
|
|
|
|
|
Hi,
I want to know what is the useful space that I have in a document ( the X-Axis of the page)...
My idea is before insert one ActiveX scale it to the optimal size in the Ms Word instance.
Thanks in advance, greetings
Braulio
|
|
|
|
|
I pass a SAFEARRAY through a Variant from an ATL-made COM to some VB testing program.
Now i have the Variant and i don't know how to extract the SAFEARRAY from it.
rechi
|
|
|
|
|
This is the second time you cross-posted! You said it wasn't a common thing for you to do. Confess, you're Satan aren't you?
Jeremy L. Falcon<nobr>
Homepage : Sonork = 100.16311
"But everybody darlin' sometimes bites the hand that feeds."
"Remember in this game we call life that no one said it's fair."
"Just because you're winnin' don't mean you're the lucky ones."
Song: Breakdown - Album: Use Your Illusion II - Artist: Guns N' Roses
|
|
|
|
|
I don't hate satan, if this is what you wanna' hear.
The cross-posting is the result of the weak probability of getting some answer on the other forums.
Why are you so angry about cross-posting?
rechi
|
|
|
|
|
Bogdan Rechi wrote:
I don't hate satan, if this is what you wanna' hear.
I don't believe in him. It was a joke.
Bogdan Rechi wrote:
Why are you so angry about cross-posting?
I'm not angry at all. I just think you're Satan.
BTW, it is not proper netiquette to cross-post. The reason why is that we don't owe you anything. We choose to help. Don't pester us with a request over and over again just because it's not answered a couple minutes after you ask it. You'll find this holds true everywhere on the Internet and not just CP.
Jeremy L. Falcon<nobr>
Homepage : Sonork = 100.16311
"But everybody darlin' sometimes bites the hand that feeds."
"Remember in this game we call life that no one said it's fair."
"Just because you're winnin' don't mean you're the lucky ones."
Song: Breakdown - Album: Use Your Illusion II - Artist: Guns N' Roses
|
|
|
|
|
I'm using a mutex object to check if a dialogbox application is running. I want to know how to call ShowWindow from the InitInstance to force the dialogbox to the foreground.
Thanks
|
|
|
|
|
|
You can call SetForegroundWindow() or SetWindowPos() to do that.
Jeremy L. Falcon<nobr>
Homepage : Sonork = 100.16311
"But everybody darlin' sometimes bites the hand that feeds."
"Remember in this game we call life that no one said it's fair."
"Just because you're winnin' don't mean you're the lucky ones."
Song: Breakdown - Album: Use Your Illusion II - Artist: Guns N' Roses
|
|
|
|
|
|
Thanks for the info!
Jeremy L. Falcon<nobr>
Homepage : Sonork = 100.16311
"But everybody darlin' sometimes bites the hand that feeds."
"Remember in this game we call life that no one said it's fair."
"Just because you're winnin' don't mean you're the lucky ones."
Song: Breakdown - Album: Use Your Illusion II - Artist: Guns N' Roses
|
|
|
|
|
I assume you want to quit the current dialog and bring
the existing dialog to the foreground.
SetForegroundWindow is the right call, but its behavior
in later versions of Windows will thwart you (it just
flashes the item on the taskbar) unless you jump the
right hoops: AttachThreadInput
Here's a great article :
http://www.etree.com/tech/Articles/attachthreadinput.pdf
And here's some code to do it:
DWORD MyThreadId=GetCurrentThreadId();
DWORD ForeThreadId=::GetWindowThreadProcessId(::GetForegroundWindow(),0);
HWND hForegroundMe=0;
// Get handle to the window you want to place in the foreground.
// For instance use EnumThreadWindows if you know the ThreadId
// (perhaps you have it saved in a shared memory?)
// or use EnumWindows if you know the window text of the window
// you are looking for...
if (GetWindowLong(hForegroundMe,GWL_STYLE)&WS_MINIMIZE)
::ShowWindow(hForegroundMe,SW_RESTORE),::UpdateWindow(hForegroundMe);
if (ForeThreadId!=MyThreadId)
AttachThreadInput(ForeThreadId,MyThreadId,TRUE);
::SetForegroundWindow(hForegroundMe);
if (ForeThreadId!=MyThreadId)
AttachThreadInput(ForeThreadId,MyThreadId,FALSE);
|
|
|
|
|
Hi, i'm dealing with a form with about 250 objects, now i cannot insert any other objects. Is there a limit for objects in a form, can i solve by code?
Thank you
|
|
|
|
|
Do all the objects need to be on the same form, or just all be displayed?
You could use property pages to split up the objects, and then display multiple property pages
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
If I recall, there is an artificial limit of around 255 controls per window. It may be OS based or editor based. Just can't remember.
As Benjymous said, splitting up the controls onto sub-pages may be the best way to go.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Well, i'm kind of new with Visual C++, i understand the function of DoDataExchange, i read a bit about DDP in MDSN, i understand the concept but i'm sure that i know how to use it, can you give me a example?
Most of my objects are used with an array, and for this form i don't have a ClassWizard, i've got a parse error when i try to call it, but the aplication works.
Thank you all
|
|
|
|
|
Classwizard doesn't like anything unexpecetd inside the DDX AFX_DATA_MAP(...) comments. If you want to use array items, just move them outside the comment block and classwizard should be happy.
If your using DDX, it would recommend sticking to control variables and not CString's etc using UpdateData() as it gives you much more control. But thats just my personal preference.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
ClassWizard is very happy now, about the variable type, i'm using, for the same object both control and text variables and i hope this is not the cause of my problem.
About DDP, is there a easy way to use it? Oor good articles about?
Thanks
|
|
|
|
|
What's the difference between #include <something> and #include "something" ?
Jeremy L. Falcon<nobr>
Homepage : Sonork = 100.16311
"But everybody darlin' sometimes bites the hand that feeds."
"Remember in this game we call life that no one said it's fair."
"Just because you're winnin' don't mean you're the lucky ones."
Song: Breakdown - Album: Use Your Illusion II - Artist: Guns N' Roses
|
|
|
|
|
#include "something" tells the compiler to look in the the source folders for your project. Use this for including your own source files.
#include <something> tells it to search the system include file paths (for including system things)
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Yep, and you'd be suprised how many open source/unix projects get this wrong. They either use all #include <>'s or all #include ""'s. Makes one feel safe using open source programs.
Joel Lucsy (jjlucsy@ameritech.net)
|
|
|
|
|
Well done for asking your stupid question. So now its my turn is it?
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
When I debug my program,in the output window,it display message:
"First-chance exception in Diary.exe (KERNEL32.DLL): 0x000006B5: (no name)."
I don't how to stop the program when the error occured.
In my program ,if the following code was executed ,it would display the error message.The code is:
char szFileFilter[]=
"Mp3 File(*.mp3)|*.mp3|"
"Mid File(*.mid;*,rmi)|*.mid;*.rmi||";
CFileDialog dlg(TRUE,NULL,NULL,OFN_HIDEREADONLY,szFileFilter,NULL);
if(dlg.DoModal ()==IDOK)
{
m_MusicPlayer.SetAutoStart (TRUE);
m_MusicPlayer.SetFileName (dlg.GetPathName ());
}
please tell me how to stop the program when the "first exception' error occured,thank you!
By the way,in my program ,I use Active Movie OCX to play MP3 file,but to my surprise,if start the program in the vc6
IDE with key 'F5',it will automatically quit when I want to play MP3,(that is ,the above code was executed).But if I start the program in explorer,it work well.
I can't solve the problem,hope you help!
Thank you very much for all your help!
Don't look at me in that way!
|
|
|
|
|
start your program, then go to VCs Debug menu, choose Exceptions. in this dialog you can choose how VC responds to exceptions.
-c
Garbage collection, making life better - for weenies!
|
|
|
|
|
We´ve been developing an app in win2000 using MFC. When we try to run it on win98 we get a debug assertion failure when we try to execute this line: CFormView::OnInitialUpdate(). The dialog says that the error is in dlgdata.cpp on line 43. Does anybody know why this error occurs.
|
|
|
|