|
I created a Win32-based (MFC, ATL and ActiveX support via wrappers) control a while back. The thing is generally useful, and I find myself using it quite a bit. The problem is that I have to constantly refer to the headers to find message and notification declarations, and then hand-code the message maps, etc.
I'd really like VS.Net to automagcially support my class as well as it does, say, COMBOBOX. Is there a way to declare the interface of my control to VS so that it can add the appropriate stuff to the "events", "messages" and "overrides" section of the properties window (shown when a class is selected in Class View. I'd really like it to work when a member of my control class is added to a dialog, AND when I use CCtrlView with my class.
Anyone have experience with this? Or, at least know where this stuff is documented?
Thanks,
|
|
|
|
|
Hi,
Here is my problem. I have a MDI App that countain some modeless dialogbox. I would like to make sure that my dialogs are always withing the boundary of my mainframe. Also, I would like to find a way that my dialogs follows the MDI App when I move the mainframe.
Any Ideas?
thanks
Everything's beautiful if you look at it long enough...
|
|
|
|
|
Have u tried using CWnd::MoveWindow for your modeless dialog?
|
|
|
|
|
MemLeak wrote:
Also, I would like to find a way that my dialogs follows the MDI App when I move the mainframe.
If you make the modeless dialog a "child dialog" via the properties in the resource editor, it should follow the mainframe when called with create() and ShowWindow(SW_SHOW).
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
I've looked all around CP and MSDN for a way to place a control (e.g. a button) within an edit control's non-client area, but haven't had any luck.
All of the implementations I have seen haven't really placed controls there, but have just mimicked the control by resizing and painting the NC area. Like this:
http://www.codeproject.com/editctrl/fileeditctrl.asp[^]
I tried just placing the control in the client area, but it gets painted over as soon as the user clicks in the edit box, which is ugly.
Can someone point me in the right direction?
Thanks.
|
|
|
|
|
Since an edit control has no non-client area the article you found is probubly the best place to start.
Trust in the code Luke. Yea right!
|
|
|
|
|
I want to get some info about hardware.
such as: name of device....
1. Operating System: Microsoft Windows 2000 Professional (5.0, Build 2195)
2. Mainboard: Chipset Via tech
3. CPU Processor: Intel Pentium III 933Mhz
4. Ram: 256MB RAM
5. Harddisk:ST340016A
6. Netword card: REPOTEC RP-1624W 100Base-TX PCI Fast Ethernet Adapter
7. Display VGA card: NVidia Riva TNT
8. Sound card: Avance AC97 Audio
9. CD Rom:
10. Keyboard:
11. Mouse: ...
Cound you help me to get this info of hardware
thank you!
|
|
|
|
|
That's a tall order as the information is scattered amongst several APIs. Try:
GetSystemInfo()<br />
GetVersionEx()<br />
DirectSoundEnumerate()<br />
GlobalMemoryStatusEx()
Other posters can surely complement this list to get a full manifest of the hardware information.
|
|
|
|
|
I have a file deleter program that deletes cookies and temporary internet files, however, it sends the files to the recycle bin.
Is it possible to secure delete the files, this means that the files are not moved to the "recycle bin", but rather are actually fully deleted from the hard drive.
|
|
|
|
|
What method are you currently using to delete with?
|
|
|
|
|
I use the following class to delete files.
void CFileDeleter::Initialize()
{
m_nDeleteType = 0;
LoadDeleteType();
}
void CFileDeleter::LoadDeleteType()
{
HKEY hKey;
long lRet;
int nType = 0;
DWORD dw = sizeof(int);
DWORD dwType = REG_DWORD;
lRet = RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\iISoftware\\iIWiper",0,KEY_ALL_ACCESS,&hKey);
if(lRet == ERROR_SUCCESS)
{
lRet = RegQueryValueEx(hKey,"DeleteType",0,&dwType,(LPBYTE)&nType,&dw);
if(lRet == ERROR_SUCCESS)
{
m_nDeleteType = nType;
}
}
}
BOOL CFileDeleter::FileDeleteOperation(LPTSTR lpszFile)
{
DWORD dwAttrib;
dwAttrib = GetFileAttributes(lpszFile);
if (dwAttrib == 0xFFFFFFFF)
{
return FALSE;
}
switch(m_nDeleteType)
{
case DELETE_RECYCLE:
{
SHFILEOPSTRUCT f;
ZeroMemory(&f, sizeof(SHFILEOPSTRUCT));
f.wFunc = FO_DELETE;
f.fFlags = FOF_ALLOWUNDO | FOF_NOCONFIRMATION;
lpszFile[lstrlen(lpszFile)+1] = 0;
f.pFrom = lpszFile;
SHFileOperation(&f);
break;
}
case DELETE_DELETE:
DeleteFile(lpszFile);
break;
default:
{
SHFILEOPSTRUCT f;
ZeroMemory(&f, sizeof(SHFILEOPSTRUCT));
f.wFunc = FO_DELETE;
f.fFlags = FOF_ALLOWUNDO;
f.pFrom = lpszFile;
SHFileOperation(&f);
break;
}
}
return TRUE;
}
|
|
|
|
|
Just omit the FOF_ALLOWUNDO flag.
|
|
|
|
|
Thank's,
I deleted the FOF_ALLOWUNDO flag.
Now I don't see the deleted files in the recycle bin anymore, but when I click on the Clean File in my program, before it deletes, for every cookie a dialog box pops: Are you sure you want to delete "cookie name"?
Is there any way I could stop that message from popping up?
|
|
|
|
|
azi_games wrote:
Is there any way I could stop that message from popping up?
Adding FOF_NOCONFIRMATION, I presume.
|
|
|
|
|
|
I'm wondering if there is an API fn to effectively perform the same as adding an entry to the HOSTS file. I seem to be drawing a blank so far with my google and msdn search attempts.
Cheers,
Phil
|
|
|
|
|
It's just a text file. Would the normal file I/O functions not suffice?
CStdioFile file;<br />
file.Open("hosts", CFile::modeWrite);<br />
file.SeekToEnd();<br />
file.WriteString("127.0.0.1 www.aadserver.net\n");<br />
file.Close();
|
|
|
|
|
Hello
I'm currently trying to port a library to CE.NET using eVC 4.0. The problem is we are using a 3rd party library that uses iostreams. There is a verion of STL that comes with eVC 4.0 but it doesn't support iostreams. I tried using STLport without much luck.
Has anybody had similar problems? What had to be done to get it to work?
Thanks!
|
|
|
|
|
Does anyone know of any way to find out info about drivers through some sort of API? In particular I am interested in the sound card driver. To be clear, I am not looking for the capabilities of the sound card, like supported bitrates, and things like that, more like, is it a VxD, WDM, etc..
Any ideas?
Marcus Spitzmiller
"Why must life be so hard? Why must I fail at every attempt at masonry?" - Homer
|
|
|
|
|
Ok... Can anybody tell me what I am doing wrong here please ?
struct MyStruct1 {
int m_integer;
}
struct MyStruct2 {
MyStruct1 *pStruct1;
}
MyStruct2 m_struct2;
MyObject::MyObject() {
m_struct2.pStruct1 = NULL;
m_struct2.pStruct1 = (MyStruct1 *) malloc(10);
}
MyObject::~MyObject() {
if(m_struct2.pStruct1)
{
free(struct2.pStruct1); <- I get error here....
}
}
|
|
|
|
|
You failed to mention if the error was compilation or run-time. Given just the code you provided, it has several compile errors. Those can be fixed with:
struct MyStruct1
{
int m_integer;
};
struct MyStruct2
{
MyStruct1 *pStruct1;
};
MyStruct2 m_struct2;
class MyObject
{
public:
MyObject();
~MyObject();
};
MyObject::MyObject()
{
m_struct2.pStruct1 = NULL; <code>
m_struct2.pStruct1 = (MyStruct1 *) malloc(10);
}
MyObject::~MyObject()
{
if(m_struct2.pStruct1)
{
free(m_struct2.pStruct1);
}
}
|
|
|
|
|
Ok.. You are right.. I didn't have enough info.. Here is what I use and I am getting run time error..'Debug error.. DAMAGE: after normal block(#42) at 0x002FO7EO.' and it is failing at free(m_Struct2.pStruct1); What do you think that I am doing wrong??
#include <stdio.h>
#include <memory.h>
#include <malloc.h>
struct MyStruct1 {
int m_interger;
int m_interger2;
int m_interger3;
int m_interger4;
};
struct MyStruct2 {
MyStruct1 *pStruct1;
};
class MyObject {
public:
MyObject();
~MyObject();
MyStruct2 m_Struct2;
};
MyObject::MyObject()
{
m_Struct2.pStruct1 = (MyStruct1 *) malloc(10);
m_Struct2.pStruct1->m_interger = 5;
m_Struct2.pStruct1->m_interger2 = 5;
m_Struct2.pStruct1->m_interger3 = 5;
m_Struct2.pStruct1->m_interger4 = 5;
}
MyObject::~MyObject()
{
if(m_Struct2.pStruct1)
free(m_Struct2.pStruct1);
m_Struct2.pStruct1 = NULL;
}
main() {
MyObject *myObject;
myObject = new MyObject;
delete(myObject);
return 0;
}
|
|
|
|
|
Actually, I think as I type it out onto the editor, I saw one problem with my logic.
m_Struct2.pStruct1 = (MyStruct1 *) malloc(10); <- Bad isn't it?
That ought to be
m_Struct2.pStruct1 = (MyStruct1 *) malloc(sizeof(MyStruct1) * 10);
Otherwise m_Struct2 is not getting created enough space for it's field..
Silly me.. Thanks for the heads up.
|
|
|
|
|
It looks like you need to use new instead of malloc() so that MyStruct1's constructor gets called. Maybe that's just for MFC, however, and not C++ in general.
|
|
|
|
|
new is c++ all the way, no MFC required
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|