|
Licensed2Code wrote:
ASSERT(::IsWindow(m_hWnd));
This test is failing because the dialog window isn't created (m_hWnd is NULL) until you call DoModal().
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Hi Mike,
So, how would you modify the code? I really apprecite it.
Hav a great one.
Jey
|
|
|
|
|
Call DoModal() to create the dialog, then in OnInitDialog() do whatever control setup is necessary.
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Hi Mike,
The Dialog is already running and in there I got the List Box.
When I press a button, it processes data from one class and sending it to the dialog class.
I've already called the DoModal() in the beginning of the application part of th InitInstance() function.
This is how it's.
CTestDlg::DoDisplay(CString sString)
{
CListBox *box = (CListBox*)GetDlgItem(IDC_LIST);
box->InsertString(-1, sString);
}
and when I press a button named "Register" from the dialog (from CTestDlg class), it calls up the following function......
CDisplay::DoRegister()
{
CTestDlg pDlg;
CString sString = "I don't know what to do";
pDlg.DoDisplay(sString);
}
The assert is thrown at the line "CListBox *box = (CListBox*)GetDlgItem(IDC_LIST);" saying IsWindow()==mHandle == NULL.
Since I've already called up the DoModal() at the beginning, I don't see why I've to call it again, and calling it again will create another dialog.
Your help is appreciated.
Jey
|
|
|
|
|
Fill the dialog with data in WM_ONINITDIALOG message handler and use it this way:
<pre>
CDisplay::Foo()
{
CTestDlg dlg;
dlg.DoModal()
}
</pre>
Pavel
<small><a href="http://www.sonork.com">Sonork</a> <b>100.15206</b></small>
|
|
|
|
|
I've already invoked the DoModal() in InitInstance() part of the application. And if I do it again, it would create another dialog which I dont' want. Anyother ideas???
Thanks...
Jey
|
|
|
|
|
Currently I'm using
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
I could easily do the same thing with SendInput() but my question is, is this the right way to simulate a doubleclick?
-Jack
If things are as bad as they can be, you can be sure there'll be a brighter tomarrow.
|
|
|
|
|
According to the MSDN the mouse_event function has been superseeded by the SendInput() function so i think it would be best to use that.
|
|
|
|
|
My program worked fine two minutes ago, but now when i enumerate a list with ACM compressors, i get a "Unhandled exception at 0x77f767cd in MP3.exe: User breakpoint." Why does it do that? I have never had problems with that before. It happens when i open an ACM driver:
acmDriverOpen(&hacm, hadid, 0);
It's opened inside an enumeration function where i get a HACMDRIVERID delivered inside the function so it should be valid. Anyone have some info on "user breakpoints" or know what could be wrong?
Thanks in advance.
-Rune Svendsen
|
|
|
|
|
Your program got lost probably and jumped randomly somewhere into memory. Maybe a stack was damaged before returning from a function.
Pavel
Sonork 100.15206
|
|
|
|
|
Any idea how to fix that?
Thanks
|
|
|
|
|
Hi dear,
How can I split a MPEG file into two or several small files or merge two or several MPEG files to one file?
What about DAT file?
Thank you.
|
|
|
|
|
I know there is a program which will patch it for VS6, but has one been released for .NET?
|
|
|
|
|
Why bother? From a command prompt you can yourself start MSDev.exe in low priority. Just type "start /?" and there you go.
|
|
|
|
|
Maybe he just want the compiler/linker etc to run at low priority, but the IDE should remain as responsive as possible...
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
newbie beware,
how could i convert this CString for an encryp routine?
CString tm;
tm = "Hello";
i've tried this, and everything else i could think of:
LPTSTR lpsz = new TCHAR[tm.GetLength()+1];
_tcscpy(lpsz, tm);
TCHAR HelloCrypt[] = lpsz;
i get, "can't convert char* too char[]"
any helps really appreciated.
shotgun
|
|
|
|
|
shotgun wrote:
TCHAR HelloCrypt[] = lpsz;
You can't assign a pointer to an array.
Should be:
LPTSTR HelloCrypt = lpsz;
TCHAR HelloCrypt[] = "Hello" is possible, because it's constant known at compile time.
It's not VB, at runtime you must create arrays of unknown size using new.
Pavel
Sonork 100.15206
|
|
|
|
|
figured it out
changed
TCHAR HelloCrypt[] = lpsz;
to
TCHAR *HelloCrypt = lpsz;
is there a better way or is this correct?
shotgun
|
|
|
|
|
If the input parameter of your routine is constant, you can pass directly the CString variable, CString has an LPCTSTR() operator defined.
If your routine need to write into the string data, you can use CString::GetBuffer/ReleaseBuffer methods.
Pavel
Sonork 100.15206
|
|
|
|
|
i have a problem with irda/connect: the code is
if (connect (sock, (struct sockaddr *)&address,
sizeof (SOCKADDR_IRDA)) == SOCKET_ERROR)
{
wsaError = WSAGetLastError();
}
wsaError returns WSAEINVAL;
There is some link that help me!
|
|
|
|
|
Anonymous wrote:
There is some link that help me!
That is correct, and I can't for my life understand why you haven't used it yourself!
|
|
|
|
|
I have an application with an MDI Doc/View architecture, and I want to call MDITile() every time I open a new unique document, so that it automatically tiles all documents.
Problem is, when I call it from within CMainFrame::PreCreateWindow, i keep getting assertion errors (wrong object type). Also, having problems getting a handle to CMDIFrameWnd() outside of my mainframe.cpp file.
Help! When/where/how should I be calling MDITile() ??
|
|
|
|
|
FlyingWren wrote:
when I call it from within CMainFrame::PreCreateWindow, i keep getting assertion errors
You can't call it from CMainFrame::PreCreateWindow. The application windows are not created yet, that's probably cause of the assertion.
FlyingWren wrote:
Also, having problems getting a handle to CMDIFrameWnd()
AfxGetMainWnd() returns the CMainFrame pointer for MDI application.
Pavel
Sonork 100.15206
|
|
|
|
|
FlyingWren wrote:
I have an application with an MDI Doc/View architecture, and I want to call MDITile() every time I open a new unique document, so that it automatically tiles all documents.
Problem is, when I call it from within CMainFrame::PreCreateWindow, i keep getting assertion errors (wrong object type). Also, having problems getting a handle to CMDIFrameWnd() outside of my mainframe.cpp file.
CMainFrame::PreCreateWindow() is way too early. Have a look at doing it in CChildFrame::ActivateFrame()
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Hello,
I am trying to develop a function that accepts one pointer to a character array, and takes out all of the white spaces in the array leaving only the characters in the same sequential order. However, I want to accomplish this by only using the one pointer passed to the function. I know this is probably not the best way to accomplish this but I know it can be done somehow. Any suggestions and help would be greatly appreciated. Thanx
I Am trying to figure out how to do this by not declaring another pointer, or variable of any type in the function.
This just seems kinda more interesting to me.
codefun
|
|
|
|