|
I have an MFC application that has some dialogs with there classes. I want to take these dialogs with the classes into a dll. How can I do that.
Please this is urgent...
Anyone knows why Visual C++ compiler causes problems in Windows 2000.
|
|
|
|
|
DLL:
Create an MFC extension DLL project with the App wizard.
Include (copy over) your dialog classes, and resources. (you can open the original apps .rc file and drag and drop the dialog templates to your dll projects resource view).
Add AFX_EXT_DLL to the declaration of your CDialog based classes (after the class keyword).
Compile the dll.
APP:
In the apps that will use it, include the now modified (AFX_EXT_DLL) headers for the dialogs and the defines for the resource ids of the dialogs - try not to conflict with any of the existing apps dialog IDs.
Add the dlls lib file to the apps project link settings.
You should be able to work with the classes in your app, as long as it can find the DLL.
|
|
|
|
|
After posting the above, I ran into some strange problems as I went to test in release - some strange problems with VC that I don't think I have seen before - seems ok now, but could you describe a bit more about the type of workspace you're working and the problems you are having?
Also, what service packs do you have for VC (HKLM\Software\Microsoft\VisualStudio\6.0\ServicePacks)
|
|
|
|
|
I want to show only shared folders in the BrosweforFolder Dialog.Normally it shows the folders / or set folder in the machine + Shared folders in other machine.But i want this default behaviour to be changed and it should show only shared folders in the machine from which it is run.Can any one have a solution ...pls reply....
|
|
|
|
|
For do it, you must use of MCI ...
In MSDN is several example about it ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
From memory ( and I could be wrong, LMK and I'll dig up my old source code if this does not work ), you need to select the row and column before doing the insert.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Thanks for the advice although I did try that. I am giving up on the FlexGrid and going with the CListView. It does what I want as well.
Thanks again,
Brad
|
|
|
|
|
OK. I'm sorry - I worked with it nearly two years ago and had constant problems, but it's too long for me to remember much about it. If you come back to Flexgrid, LMK and I'll be happy to dig around some old backup CD's for my source code.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
No problem at all. Actually I am happier using a ListView instead. I feel more comfortable with it.
Anyway, thanks again,
Brad
|
|
|
|
|
christian is right ... you have to set the current row and current column before doing the insert
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
I want to use MSDEV as the editor for a rather lame, but other necesary IDE we are using. The options I've tried so far are:
1) I can pass the "msdev <filename>" as the command line, but it starts up multiple instances of developer studio.
2) I can pass just the name of the file, and if an instance is already running it uses that
However, I need to also pass an optional line number. It seems my only choice is to use a macro, but that leads back to the problems with 1.
Any suggestions?
|
|
|
|
|
You could write a quick little application that sends DDE commands to MSDEV.
-Ben
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
Hey Gang,
It has been a very long week and my brain is totally fried.
I'm trying to use the function CoSetProxyBlanket and getting a return of "undeclared identifier", however, CoCreateInstance operates perfectly and they are both defined in objbase.h.
What did I forget?
|
|
|
|
|
Hey Rhoam.
Yeah, it was a rather long week - but the solution is a quite simple : add this definition into stdafx.h #define _WIN32_DCOM and enjoy.
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
DOH! I knew it would be simple.
Thank you very much for your assistance. Think I'll take the rest of the weekend off and get some sleep!
Rhoam
|
|
|
|
|
Can anyone tell me how to test the memory leak......this test can tell me where the leak is.....
Also....i have one more question.......When i write a WinNT program and want to transfer to Win9X, do i have to do some modification to the program? If yes....what? Because....seems liked always has problem if i'm doing that.....
Thanks
|
|
|
|
|
Question 1: Boundschecker will help you find memory leaks, but it's quite expensive. There are some alternative wrappers around that basically wrap 'new' and 'delete'. First of all, do you realise if you run in debug mode, when you exit VC tells you the locations of memory leaks ? It sometimes gets it wrong, but may be able to help you.
Question 2: There are a number of issues. First is Unicode, which I don't know enough about, so I'll leave it to someone more knowledgeable. I know that a program not compiled for Unicode running under NT converts all strings to Unicode as it passes them on, but I'm not sure about vice versa, having read Richter four times and still understanding about 1/10th of it ( largely because I've not had opportunity to *work* with the stuff in there ). Second, there are commands certainly in GDI that NT supports and W95 does not. I'm not sure if W98 supports them all, but I don't think so. I'd venture a guess that this would be true in other areas as well, and if you look in the MSDN, some commands accept different parameters in different OS, etc. However, having said that, by steering clear of such commands and writing my own, I've had no problems running my paint program under W95 W98 WME NT4 and NT5, so I wouldn't have thought it was a major issue.
What problems are you having ?
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
BoundsChecker is indeed afaik the best tool for finding memory leaks (and not only). If You cannot afford it, maybe try the evaluation version - there should be some.
In MFC exist several functions which may help You. See for example:
AfxCheckMemory, AfxEnableMemoryTracking, AfxSetAllocHook...
Though I still recommend You BoundsChecker
|
|
|
|
|
I didn't suggest the evalutation of BoundsChecker because getting one is like pulling teeth. Fill in a form, pass a phone interview, download the demo, get call after call from reps who know the lingo but wouldn't know how to write a hello world program....
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
When using the SetWindowPos the first parameter a const CWnd*.... so.. HWND_TOPMOST is not able!
so I checked the MSDN library and then I saw a nother constant to send... wndTopMost...
BUT damn VC++.... the MSDN library says SetWindowPos has a const CWnd* parameter but when using the
wndTopMost the compiler error is cannot convert parameter one from const CWnd to const CWnd* !!
HEEELP!!!
I know that sounds crazy but thats it!!
/*
BETA
*/
|
|
|
|
|
You should use &wndTopMost and make sure that SWP_NOZORDER flag is not set.
Does it help?
Farhan Noor Qureshi
|
|
|
|
|
have you tried &wndTopMost instead just wndTopMost?
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
&wndTopMost. You'll find that & converts a variable to a pointer to that variable. * dereferences a pointer ( converts back )
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
I want to set the font in a MDI-application. So I need a command like "UpdateAllViewsInAllDocuments", but that doesn't exist.
Any suggestions?
Thanks
Friedrich
|
|
|
|
|
You could use:
CWinApp * pApp = AfxGetApp ();
ASSERT_VALID ( pApp );
POSITION posTemplate = pApp->GetFirstDocTemplatePosition ();
while ( NULL != posTemplate ) {
CDocTemplate * pTemplate = pApp->GetNextDocTemplate ( posTemplate );
ASSERT_VALID ( pTemplate );
ASSERT_KINDOF ( CDocTemplate, pTemplate );
POSITION posDocument = pTemplate->GetFirstDocPosition ();
while ( NULL != posDocument ) {
CDocument * pDocument = pTemplate->GetNextDoc ( posDocument );
ASSERT_VALID ( pDocument );
pDocument->UpdateAllViews ( NULL );
}
}
-Ben
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|