|
I would like to create a dialog window from a win32 console program, but i dont know how to go about doing
this. Anyone know how? I created the CALLBACK procedure, and the resource template, but when i go to call
CreateDialog(), i do know what to pass in for the current instance, and the parent window, and NULL does
not work (it will compile, but it won't create the window).
--Dave
|
|
|
|
|
Hi Dave
I think what is missing is
ShowWindow(SW_SHOW);
NULL as a parent works fine, I tested it
CTestDlg::CTestDlg(CWnd* pParent)
: CDialog(CTestDlg::IDD, pParent)
{
Create(CTestDlg::IDD, pParent);
ShowWindow(SW_SHOW);
}
|
|
|
|
|
I have a memory address stored in a variable (gotten from a stackwalk), like so
int address = 0x00FE3D; // an arbitary address
How can I check whether my process has access to that address??.
PS. I was looking at IsBadReadPtr() but it requires a pointer to memory block. How can I get a pointer that points to the value specified in a variable?
|
|
|
|
|
Just pass a block size of 1:
void* pv = (void*) 0xfe3d; <br />
bool bCanRead = !IsBadReadPtr ( pv, 1 );
|
|
|
|
|
Is there any function, etc, available to search through all the items in a tree ctrl by name?
E.g. I populate a tree ctrl, then need to go back and add a new item 'D' as a child of item 'C':
ROOT
|-A
| |-B
| |-C
| |-E
|-F
|-G
Becomes:
ROOT
|-A
| |-B
| |-C
| | |-D
| |-E
|-F
|-G
How can I find and return the HTREEITEM pointer to 'C'?
Thanks for any help,
David Wulff
|
|
|
|
|
http://codeguru.earthweb.com/treeview/find_item.shtml
|
|
|
|
|
Hi,
I want to display a bmp file into my active x control. What is the way to do this thing.
Regards
Muhammad Ali
|
|
|
|
|
I am having problems building a 2 dimensional dynamic array. I built a one dimensional dynamic array, but I don't know were to start with a 2 dimensional.
I cannot find any helpful documentation on it so far on it. Any comments?
|
|
|
|
|
int nRows = 6;
int nCols = 3;
int ** cp;
// Allocate rows
cp = new int *[ nRows ];
// Now allocate using a loop
for ( int index = 0; index < nRows; index++ )
{
cp[index] = new int [ nCols ];
}
cp[5][0] = 1;
cp[5][1] = 2;
|
|
|
|
|
Hi!
I am writing a debugger. In my Watch-View (which is basically a ListView) I have to check the user input of new variable values for validity (eg. a variable of type int must not be assigned the string "qwerty"). I do this now
by checking the validity when the editing has already ended (using a LVN_ENDLABELEDIT handler). If it is not valid, I do not set the value.
What I WANT to do, is to prevent the user from ENDING editing, unless he has entered a valid value or he cancels editing.
Any hint would be appriciated,
Hamader Peter
|
|
|
|
|
From MSDN:
"If the pszText member of the LVITEM structure is non-NULL, return TRUE to set the item's label to the edited text. Return FALSE
to reject the edited text and revert to the original label. "
(See MSDN Online)
Cheers,
Paolo.
|
|
|
|
|
|
Is there a way I can use popen() in my windows app to open a dos app and use its output?
|
|
|
|
|
Using CDateTimeCtrl or inheritance, how can I init the non checkbox to FALSE (not set)?
|
|
|
|
|
Hi
would
ctrlDate.EnableWindow(FALSE) do?
Kurt
|
|
|
|
|
Thanks for your interest.
I already have done this and the window is disabled preventing dropdown and changes. However, it still is checked for a return and does return the default system date. I am looking for a way to force GDT_NONE result on return when the dialog closes.
I am also looking to have the checkbox not checked for the default state when the control is enabled which would be more appplicable for certain uses of the application. Eventually the default state would be part of a prferences setup.
|
|
|
|
|
Hi there,
I had two questions...
When creating a context menu for a treeview let's say, how can you tell whether the user has actually right clicked on the treeview or somewhere out in the empty spaces? From what I can see, I only have two points, an x and a y, but I have no information on the treefolder item that was right clicked on....
Also, once the user picks, let's say the copy option and you handle the pick, what MFC class do you use to actually copy the whole folder into another one?
|
|
|
|
|
even if the right-click is out in space, there will always be an item selected in the tree.
so,
void CObjTreeCltr::OnRclick(NMHDR* pNMHDR, LRESULT* pResult)
{
HTREEITEM hti = GetSelectedItem();
if (hti!=NULL)
{
and so on....
-c
|
|
|
|
|
Hi All:
Any helpful material on RDS( Remote Data Service) development with VC++ . I only
know VC++. Please try to avoid VB and ASP ( I know it is possible )
Just my (VC++)control on the client, and business and server objects
at the back ( Remind you only VC++ specific material ).
I know there is MSDN. But it is not toospecific about VC++..
Tutorials, Code snippets,references .....all welcomed
|
|
|
|
|
Is there anyway at runtime to add a string into the string table? What I am trying to do is have a thread load a string to the string table, then use postmessage back to the main thread. Inside of the main thread message handler I want to pop up a warning dialog that will display the string I added to the string table. Is this viable, if not what other approaches could I use?
|
|
|
|
|
What you're asking is not viable really. Remember that string resources are embedded in the executable, thus adding a string at runtime, permanently adds the string to the executable (even if it were possible to add one while another executable is running, which is usually not possible because the file image is locked).
What you probably want to do is simply send a string to another app and have that app display it. You can do this using the WM_COPYDATA message, which you can then add a WM_COPYDATA handler to your application.
|
|
|
|
|
What Eric suggested is the best way, but if the two threads are within the same process, all you need is a user-defined message and to use either the WPARAM or LPARAM to send a pointer to the string.
Here's how you do it with a user-defined message the last parameter is LPARAM and is not used in this example) - I also assume you're using a CString, hence the double-cast for the WPARAM:
void CMyClass::SendMyMsg(CString sMsg)
{
SendMessage(UWM_MYMESSAGE,(WPARAM)((LPCSTR)sMsg), 0);
}
In your message handler, you'd do this:
LRESULT CMyDialog::OnMyMsg(WPARAM wParam, LPARAM lParam)
{
CString sMyRcvdMsg = (LPCTSTR)wParam;
// do something with the string now
return 1L;
}
Using WM_COPYDATA is MUCH more flexible however. I'm working on an app right now that uses WM_COPYDATA quite extensively because of the added flexibility. When it's done, I will be posting it here.
|
|
|
|
|
That is what I ended up doing. I was more curious than anything about posting into the string table, seems like something that would be neat (technical term) to be able to do though. Thanks for the help!
|
|
|
|
|
Hi,
Is there a visual studion option which would
help me to execute a file, somewhere in my drive, after
a successful compilation.
I need this because, i want to copy my executable/dll from the debug folder a different place for execution, write now i'm doing this with a batch file, any other technique to automate the process which could also, take care whether the executable already in memory, which means the file copy could not be done .....
Thanks in advance.
Cheers
Kannan
|
|
|
|
|
Hi Kannan,
Look in the "Project settings" for the "Post-build step" tab. Here you can add a list of commands you want to execute after a successful build.
I'm not sure, I used it only one time to copy a dll in the project directory. You may also use some special strings, see the docs.
Cheers,
Paolo.
|
|
|
|