|
thanks a lot.. i came across same link yesterday and could do it.. and now am assured what i have done is indeed a correct way... thanks
Harsha
|
|
|
|
|
Hi: How can i code a dialog box without using the wizard? I have tried inserting a resource but with no success. Pliz help.
TreeS
|
|
|
|
|
You can right click on the resource window and select Add resource and and select Dialog and click New button
|
|
|
|
|
When you insert dialog to your project its invisible you can set visible to true of property window or use of ShowWindow or when you want to create it use of WM_VISIBLE
|
|
|
|
|
Wamuti wrote: I have tried inserting a resource...
But did you add any code so access said resource?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I am using directx 9 and I am wanting to create a billboard in my program.. I understand that in 3d programs billboards are used for fire, explosions, trees, ect... and they can rotate with the camera view to give a 3d effect...
I know there was an example with directx 7.
Does anyone know were I can find an example of fire or something in 3d?
or point me in the right direction?
I know they use 2d bit maps/sprites-or is that all it is?
Thanks for any help given...
|
|
|
|
|
I have seen this question before ,but i dont get the answer i want.
I develop programme with VC6.0 SP6.When i export a modal dialog in MFC extension DLL , i get the Debug Assertion.The most weird is when the DLL and the app(which uses the dll)are both Debug or Release Edition , every thing goes well.But when the DLL is Debug Edition while the App is Release Edition, i get a Debug Assertion Failed at AfxGetResourceHanle .What causes this happen????
I need your help~~~~~~~~
Thanks in advance.
|
|
|
|
|
What line of what file is asserting?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
thanks for your reply.
The Debug Assertion occurs at line 22 in AFXWIN1.INL,
//
_AFXWIN_INLINE HINSTANCE AFXAPI AfxGetResourceHandle() //line 21
{ ASSERT(afxCurrentResourceHandle != NULL); //line 22
return afxCurrentResourceHandle; } //line 23
//
I think it must be a abnormal initialization of module state in App.But i dont know how to fix it.
|
|
|
|
|
In your exported Test() function, do you have the following as the first statement:
AFX_MANAGE_STATE(AfxGetStaticModuleState());
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
for the purpose of test , i created a compeletly new MFC extension DLL project and a accompanying MFC EXE app which implicitly loads the MFC ext DLL .Then i insert a Dialog resource by using wizard and dynamically create a instance of class CDialog using the dialog resource i inserted before. After that , i invoke the DoMdal() method of the CDialog instance and wrapped this invoke into a exported function named Test . Then , rebuild and produce the debug edtion of this DLL.
In the app , i just call the function Test . Of course , the app is release edtion. Then , run the app , and the debug assertion occurs.
just before the invoke of DoModal() function ,i insert a statement :
//
AFX_MODULE_STATE *pState = AfxGetModuleState();
//
Run debugger , I found that resource handle ,moudle handel , and winapp object..ect , all were NULL.So this could explain why the debug assertion raises. Then , i change the app into debug edtion , and found that all the fields in the AFX_MOUDLE_STATE were correctly filled.
how could this happen??!!!!!!!
|
|
|
|
|
Now faced with the same problem. Tell me, how did you solve it (if you figured it out)?
|
|
|
|
|
i have to create a delay message box ie to display a message with some time delay. how to do this. pls help me.
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Your question is very unclear. The basic approach to this sort of problem is to consider the functions you need to call to make the message box do what you want, then use WM_TIMER messages to make this happen. Lookup CWnd::SetTimer and CWnd::OnTimer in MSDN and then try to make something work.
I assume that you searched codeproject, so the article "Delay MessageBox with auto-close option" is not what you want. If it is, I think it would be good practice for you to find it.
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
thanks i got a sample project here.
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
As previous poster, I'm not sure about your question. But my guess is , you are looking for something similar to Delay message Box[^], by Shog9, Nishant Sivakumar .
Prasad
MS MVP - VC++
|
|
|
|
|
Hi All!
I need your help for Digital Rights Management,I have sample Examples from Microsoft.But One of them is not working.and that is "UncompAVIToWMV".
its console application it is used for converting AVIToWMV. Even I am ready to provide the sample
for that.Can any body help me?
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
Hi I am looking for a profiler for old MFC/WIN32 app in VS6 environment, Checking out BoundsChecker, it looks great (click to see profiler screen cap) and it seems to support VS6 with SP5 (system req here), but it seems to be a bit expensive (in my humble opinion, price list here[^]) and I need it fast (if free or cost very low enuf I can skip the normal purchasing process which takes too long), even if just an eval edition
Also checked out AQ Time, still costs US$500 - but it's pretty user friend and you can get up and running really fast.
Is there any alternative? Many thanks.
devy
|
|
|
|
|
Hi,
I've been coding for a while - and have used MFC in the past. I've run into a situation where I can't avoid using the Doc/View combination.
Here's where I'm having trouble. I built a mostly complete Sudoku game without the Doc/View classes, but now I am required to have Save and Print functionality - so I'm trying to switch the code over from just a MainFrame class to the Doc/View combo.
Most of it is translating OK, but I am having trouble with my CButtons. I can't get them to display. Where should I place the CButton btnTest.Create( /// ) code?
Any ideas?
Thanks in advance,
Walt
|
|
|
|
|
Walt Austin wrote: Where should I place the CButton btnTest.Create( /// ) code?
In a WM_CREATE handler (OnCreate()) for the parent window is a good place, after calling the base
class OnCreate(). That's the first chance you get with a valid parent HWND.
Switching to Doc/View architecture seems kind of extreme for save and print functionality IMO.
Whatever works I guess
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
|
Thanks for the link. I checked out the site, but can't seem to find an example where the doc/view is being used with CButtons. Actually I spent several hours yesterday looking on the web for an example of this - but never found one. Maybe I was looking in the wrong places?
Usually if I can see a single example of what I'm trying to do - it's a painless process from there on. Do you have an example that you could point me towards?
Thanks for the help,
Walt
|
|
|
|
|
Thanks for the suggestion.
I will try it later today.
Mark Salsbery wrote: Switching to Doc/View architecture seems kind of extreme for save and print functionality IMO.
Whatever works I guess
So - I saw an article for printing without the doc view, but originally thought that switching to the doc/view would be easier. Now I'm starting to change my tune. The doc/view feels pretty awkward to me, to be honest. I'll see if the print functionality could be done any simpler.
About the save - I could save my user data as a flat file, but were you refering to a Serialize function call? Just curious as to what you think is easier.
Big thanks for all of the help.
-Walt
|
|
|
|
|
Doc/View is fine if you're ok with being bound to it. It provides an object-oriented solution
to common document/view related tasks.
I'm just saying that if you have a program already up and running without it and you want to add
printing and saving then it could be a pain to change the architecture - maybe more trouble
than it's worth.
For saving, whatever format you want the file to be I suppose. Using MFC serialization may make
your file format too MFC specific - maybe you want the format to be easily usable in other
systems. If that's not an issue, the advantage is it's easy to implement and it comes with
built-in versioning on the serialized stream.
For printing, MFC has alot of handy code written for you for common tasks. The cool thing is
that the source code is there so you can pull stuff you need from it.
I guess it's always a trade off. I personally found that my projects that started with doc/view
got progressively harder to customize because my UI went a different direction than the way
doc/view does it. It's generally in my way these days. If I was writing a word processor it
would be great.
All just my opinions/rants
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Walt Austin wrote: I can't get them to display.
Where?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|