|
Has hWnd been set to null in the constructor? This should not cause your problem though.
Otherwise it looks like you have corrupted some memory location, possibly in this class, try cutting it down to be as small as possible, if possible just have the constructor and destructor, if that works keep adding bits of code, or bench check the source code.
It is amazing what you can accomplish if you do not care who gets the credit. - Harry S Truman
|
|
|
|
|
ENewton wrote:
CPrefsDialog::~CPrefsDialog(void)
Remove the void keyword from the parameter list. I don't think this is valid syntax for a destructor, which takes no arguments.
Software Zen: delete this;
|
|
|
|
|
Hi,
I have developed a graphics intensive application based on a MFC CView and GDI+. In order to quickly develop a good user interface for this application, I am considering the possibility of converting the application to operate as an ActiveX control and moving the UI development over to a RAD tool. The performance of the ActiveX control would be an important issue.
I have no experience of developing ActiveX controls, can somebody point me in a good direction to start? Also does anyone have any thoughts on this idea, could it possibly be a false economy?
Thanks in advance,
Rich
|
|
|
|
|
It may require some work. However, all this is implementable and straight forward: unless you are currently using an interface/callbacks from your View, that may not be or difficult to convert to Automation.
It's very important to start conversion with as minimum changes to your CView class. Therefore, i would recommend hosting your CView directly as a child of an ActiveX Control window (maybe even together with CFrameWnd).
I can't give you some published directions on that conversion, because I just don't know of them. However, I've done such several times.
If implemented properly, I don't think you will see any major performance hit due to ActiveX inproc COM calls.
As to could it possibly be a false economy: sure it could -- depends on your application, it's customer base, future of MFC/CLR.
I would say: if you have already implemented MFC portion: conversion to ActiveX is much simplier then writing from scratch either as ActiveX or WinForm.
Regards
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
Hello,
I need to retrieve the list of Domains, and or Workgroups available to my computer. Right now I can retrieve a list using NetServerEnum, with SV_DOMAIN_TYPE_ENUM, however this list is wrong as it retrieve the correct number of domains/workgroups but only the primary name is shown. The other is shown with a null entry for name.
After I have the correct list I can determine if its a domain or workgroup with NetVerifyName...I think.
After that, I can list the computers with NetServerEnum using SV_TYPE ALL.
So, my question is...how can I get the correct list of domains and workgroups available?
Thanks!
Frank
"Keyboard Error - Press F1 to Continue"
|
|
|
|
|
I figured it out. I was using LPSERVER_INFO_101, when I switched to LPSERVER_INFO_100 it worked and I was able to get everything sorted out.
Thanks,
Frank
"Keyboard Error - Press F1 to Continue"
|
|
|
|
|
Hi !
The topic states it pretty well, but let me specify a little. I am building an application which uses a HTML template (mailbase.html) to send e-mail. Now, I currently have the CFile constructor to find & open this file from the same folder as the executable. However, I would like to reduce the number of files visible to the end user.
So, the necessity would be to include the HTML file to the project's resources, and use the CFile to open this "resource file" instead. Question is, what must I write for the first parameter of the constructor (filename) in order to have it search inside the executable instead of the directory where the executable is ?
Or, if the CFile isn't an appropriate solution, what should I do ? The idea is that the software opens the HTML file, copies it to CString, finds comment spots there and replaces them with appropriate information. So, a "standard" way to use a HTML template
I am using version 2003 of MS Visual Studio, but all tips/tricks, including those for older versions, will be helpful.
Greets,
Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
|
Maybe I'm totally missing the point here, but if you want to read the file, and then copy it into a CString , why not just include it as a string resource and use CString::LoadString to load it
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Thank you both for a swift response.
Mike's suggestion yielded a working solution. Using a string resource might have worked as well,
but pushing 3 kb of HTML code into a string resource just didn't sound nice.
If nothing else, it would look ugly in the String Table
I'll post the code snippet here in case someone wants to utilize it.
I must say though, it looks like a SERIOUS hack
Note that you need to check the resource integer number for FindResource() manually from 'resource.h'
<code>
// Load the HTML file
char* ptrChar = (char*)LockResource(LoadResource(NULL, FindResource(NULL, "#130" ,RT_HTML)));
// Construct a CString from the resource
CString HTMLFile(ptrChar);
</code>
Greetings,
Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Antti Keskinen wrote:
Note that you need to check the resource integer number for FindResource() manually from 'resource.h'
No, just use MAKEINTRESOURCE :
FindResource ( NULL, MAKEINTRESOURCE(IDR_YOUR_HTML), RT_HTML ); And some error-handling would be good too.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Ericahist updated (again) Sep 6!
|
|
|
|
|
Well, now it's a complete haxor
Greetings,
Antti
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi
Ok i create a non modal dialog. My Problem is that this dialog is always in the foreground. When I click on my main dialog the created Dialog should be in the background.
How can I make this?
(Sorry for my bad English)
Mfg DarkMarine
|
|
|
|
|
Given that the dialog window is modeless, it should nt remain topmost. Post the code that creates it.
Kuphryn
|
|
|
|
|
|
Thank you for your help it works now
Regards
DarkMarine
|
|
|
|
|
i've written a up/download monitor and i want to include a feature that allows be to monitor routers, has anybody an idea how to do that ?
Thanks
Mario
|
|
|
|
|
I never did something like that, but probably I would look how to use the SNMP (Simple Network Management Protocol) that is supported by the majority of routers, or maybe for home devices the new UPnP stuff can also provide some info.
Hope I'm right and it helps you a bit to find the way
|
|
|
|
|
Hi all,
I have developed a Dialog based application in VC6.0
As you all know the first dialog is a modal dialog.
I have created another dialog resource and called it as a modeless dialog from the main dialog window.
Now the problem is the modeless dialog won't minimize like the main dialog, rather it minimzes above the taskbar.
What I want is to minimize the modeless dialog like normal applications in the taskbar.
Please someone helpe me in this regard.
The Phantom.
|
|
|
|
|
Interesting. What do you mean above the taskbar?
Kuphryn
|
|
|
|
|
Hi,
Its a nice idea to reproduce the same problem yourself.
Make a dialog based application and then create a modeless dialog inside that dialog by calling Create(), then checkout what happen.
If you are interested then solve me this problem.
Thanks.
The Phantom.
|
|
|
|
|
hello guys
there's this program skinmagic toolkit for designing skins
it has the extention .smf , i'd like 2 know how 2 apply this skins 2 my writtin vc++ programs,is this file (.smf)
some kind of library that should be included,or i don't know i started the visual stuff only 2 weeks ago,thanx previously..
hail 2 all metal listeners...
|
|
|
|
|
This is a commercial application which I assume comes with comprehensive documentation. I suggest you start there.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Hi,
In my SDI application in a FormView I use two dialogs (multi-form application) one of them is dynamically selected at runtime.
So, I can't add any variables of the controls on the second dialog to my view class because it gives error at runtime as it can't associate that variable with the first dialog, because of the way the variables are defined, like as follows:
public:
//{{AFX_DATA(CFormTestView)
enum { IDD = IDD_DIALOG1 };
CEdit m_EditCtrl;
//}}AFX_DATA
Now my problem is: in the second dialog I have a list control and I want track dbl-click and rt-click messages from that control. So, I have a class CMyListCtrl which is subclassed from CListCtrl. As I can't have a variable of my List Control, how can I associate the List Control to CMyListCtrl so that I can handle the different Events?
Please advise
|
|
|
|
|
I don't want to change my design and make multiple views. Please help me on this:
I can't have a variable of a List Control (I know the resource ID), I want it to be an object of CMyListCtrl which is a class derived from CListCtrl.
Now, I have written handlers like the following:
void CMyListCtrl::OnEndLabelEdit(NMHDR* pNMHDR, LRESULT* pResult)
{
*pResult = TRUE;
}
How do I associate my Control to CMyListCtrl, so that these handlers are invoked? Please help, I'm stuck here
Thanks
|
|
|
|