|
It depends. If in your case myobj is a member of your dialog where the list box belongs to and if myobj is associated with that list box, then no. If you created myobj in some function locally, then yes. Maybe you can have a look at the MFC Controls -> List controls section for some sample code to study.
Regards
Marcus
|
|
|
|
|
Learn to better look at the exception, I think the ASSERT is yelling coz theres is not window. In Window you gotta create first the window and THEN work with them. I do loading often in the CWnd::OnShowWindow(...) function
Greetings from Germany
|
|
|
|
|
KarstenK wrote: Learn to better look at the exception, I think the ASSERT...
While it very well may be an assertion that fired (i.e., nonexistent window), the OP stated it was an exception that was thrown.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Get a book on MFC. You're not using the class correctly in the first place. All MFC objects that wrap Win32 primitives like HWND, HDC, etc, have a similar pattern:
CWnd wnd; //make a new instance
or
CWnd* wnd = new CWnd();
//"create" the instance
wnd.Create(......);
or
wnd->Create(.....);
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
can i use DoModal function...
i dnt knw how to use create...can anybody tell me????
NT
|
|
|
|
|
Again, you're using terms incorrectly. Saying you want to use a "modeless listbox" doesn't make any sense. I suspect what you want is to display a modeless *dialog* with a list box in it. Look up CDialog, and the differences between DoModal and a modeless dialog in MSDN.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
Hi,
I'm need a class or sample code for the vertical text into the Edit Control. How to make it?
Help me if you can!
|
|
|
|
|
there are several articles about that on Codeproject. have you searched a little around there ?
|
|
|
|
|
I'm not found this solution in the captions of the "Edit Controls" articles. Can you get a link?
|
|
|
|
|
Draw vertical text is very very simple:
CFont VertFont;
LOGFONT LogFont;
HorzFont->GetLogFont(&LogFont);
LogFont.lfEscapement=900;
VertFont.CreateFontIndirect(&LogFont);
tmpDC.SelectObject(&VertFont);
tmpDC.TextOut(x, y, "bye bye, Russell");
Russell
|
|
|
|
|
Your sample for drawing and not for the CEdit-derived classes. Changes CEdit font by SetFont methods hasn't effect.
|
|
|
|
|
Another way then is to put a normal CEdit control invisible somewhere, then drow it and on a tmp DC, rotate it 90 degrees and than draw it in the real DC.
But, then, probally you have also to wrap (and rotate) the mouse interaction to send right information to the real CEdit control.
Russell
|
|
|
|
|
Hi I have developed a program in C++ and I would now like to implement a sort of uninstall function which will delete all the files created so far by the application, including the application itself. How can I do it, since the application can't delete itself if it is still running?
Any advice please!
jEDI
|
|
|
|
|
actually, it can, as the program is loaded in memory when it runs...
|
|
|
|
|
toxcct wrote: actually, it can
Actually, no, as the exe is locked.
Windows handles this different from Linux.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
keep the track of all the files crested by ur application To kill ur exe use ExitProcess() when u dont require it
never say die
|
|
|
|
|
What's the syntax of ExitProcess()?
Could you please make an example as if I wanted to delete a program called Program.exe
Many thanks
|
|
|
|
|
J_E_D_I wrote: I would now like to implement a sort of uninstall function
Do you need an Installer?
Try NSIS[^]. Its free.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
|
toxcct wrote: Inno Setup
But that need scripting in Pascal!
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
jhwurmbach wrote: But that need scripting in Pascal!
Oh come on, no install program is that complicated for you to not cope with Pascal for a few lines...
|
|
|
|
|
J_E_D_I wrote: ...including the application itself.
See here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
A simple way is use the key RunOnce on the windows registry to delete all files and directoryes.
Also you can run a bat file that do this, or, of course, you can run an exe file to do this and delete it after that it ends.
Russell
|
|
|
|
|
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce
Russell
|
|
|
|
|
I am wondering if anybody could help. I have written a program in C++ and now I need to read and create Registry Keys. I know how to do it in VB (it's pretty simple) but I have no idea on how to do it in C++. I didn't find VS and MSDN online help resources very useful.
To read a key I have tried:
#include "stdafx.h"
#include <ctime>
#include <math.h>
#include <fstream>
#include <string>
#include <iostream>
using std::dec;
using std::hex;
using namespace std;
#include <iomanip>
using std::setprecision;
using std::setbase;
#include <cstdlib>
using std::atof;
#include <windows.h>
#pragma comment(lib, "user32.lib ")
#include <stdio.h>
int_tmain(int argc, _TCHAR* argv[])
{
HKEY temporarykey;
TCHAR License[64];
DWORD lpcbData = 64;
LPCWSTR lpPointer;
char Licenza[] = "License";
lpPointer = &Licenza[0];
lpPointer
RegOpenKeyEx(HKEY_LOCAL_MACHINE,
"SOFTWARE\\XXX\\License",0,
KEY_QUERY_VALUE ,&temporarykey);
RegQueryValueEx(temporarykey,
"License", NULL, NULL,
(LPBYTE)License, &lpcbData);
RegCloseKey(temporarykey);
return 0;
}
But I get these two errors:
Error 1 error C2664: 'RegOpenKeyExW' : cannot convert parameter 2 from 'const char [23]' to 'LPCWSTR' c:\documents and settings\edy\my documents\my programs\giovi read reg key\giovi read reg key\giovi read reg key.cpp 31
Error 2 error C2664: 'RegQueryValueExW' : cannot convert parameter 2 from 'const char [8]' to 'LPCWSTR' c:\documents and settings\edy\my documents\my programs\giovi read reg key\giovi read reg key\giovi read reg key.cpp 34
What am I doing wrong? I am working in c++ / Console Win32. Any advice please? Thank you
jEDI
|
|
|
|