|
A check with Spy++ shows that the parent is the main visual studio window and the window class name is VsChannel. Why do you need this information?
|
|
|
|
|
I want to write this control.I want to learn it because i don't know from which control i must derived my control.
Thanks.
|
|
|
|
|
|
hey all..
how do i send /post message from my mainframe to a dialog window???
say for eg.,
to indicate a view windoe..we do
in mainframe.cpp file,
GetActiveView()->PostMessage(WM_PLOT, NULL, 0);
hence , this automatically goes to plot in view.cpp file.
how do i do this to a dialog window instead of a framewindow?
thanks in advance.
|
|
|
|
|
Same way for your dialog window.
oMyDialogObj.PostMessage(WM_PLOT, NULL, 0);
|
|
|
|
|
thanks,,
iam jus learning and trying new things...sorry if it would sound simple and silly..
I open this dialog window like this in the mainframe.cpp
void CMainFrame::OnStatusRegs()
{
CStatus_dialog myopen;
myopen.DoModal();
}
void CMainFrame::OnPortRx(WPARAM wBytesRx, LPARAM lEvt)
{
---
---
myopen.PostMessage(WM_PLOT,NULL,NULL);
}
in this way, everytime this OnPortRx is called, the WM_PLOT will be indicated to the status dialog window and the necesary plot function will be executed. am I correct? can i do this way?
Please let me know if iam wrong.
|
|
|
|
|
Firstly, your dialog object is created in OnStatusRegs(). Upon exiting this function, your dialog will be destroyed so you can't post message in OnPortRx(). Another thing about your dialog is that you are creating it as modal, which means when your dialog is shown, you can't interact elsewhere in your application, until that dialog is closed. Is that what you want?
|
|
|
|
|
thanks.
My dialog window has to open on clicking a toolbar(STATUSREGS) on formview window.
that is the OnStatusRegs() within which I call the dialog using DoModal();
This is the way I knew. So i did it like this.
But I want the edit controls in my dialog page to be updated with values that are received in the OnPortRx() function.
How do i do it.?
|
|
|
|
|
You need to create your dialog as modeless. Here's an example[^] i found. Also, you should create your modeless dialog when your application starts and just show/hide it in OnStatusRegs().
|
|
|
|
|
hi,
Basic layout of my application,CView1 is TreeView,FormView is one pane ,Cview2 in other pane...
---------------------------------
-
- Formview1
- Cview1 ---------------------
- Cview2
-
---------------------------------
In CFormView1 i have created tabcontrol,consiting of two tabs,the client area of the CFormView1 "rect" is given as i/p to Create tabcontrol,in each tab i am having a ListControl.The client area of the tab "rect" is given i/p for listcontrol creation,I have handled WM_CONEXTMENU,in Tabcontrol class,i have two item in the contextmenu,one is "print" and other is "preview".i have Handled ON_COMMAND for both,i have overriden,Onpreprinting and OnPrint,in respective onCommand,i have called CFormView::OnFilePrint(); and CFOrmView::OnFilePrintPreview();,When i click the print item in the context menu,it is printing,when i click preview i am getting preview,but when i click print button in the preview,it is not printing,my code is called while preview,Zoom and Zoom,it`s not called only when i click print button in the preview dlg,what could be the reason..
Thanks in Before
James
-- modified at 20:39 Thursday 29th June, 2006
|
|
|
|
|
its previous error(yes),Are you sure that your function(button) is running when you click it.
whitesky
|
|
|
|
|
Hi everybod,
I would like to know whether there is any function to check the availability of the destroyed dialog box.
In brief, I have destroyed a window using OnDestroy() for some reason ( doesnt close it, still its in the display). If i check the memory allocation of the window, everytime i get NULL after the OnDestroy function. But the window is still in the dispaly. is there any other method to check the availability of the window after OnDestroy Function?
Thanks in advance.
Regards,
Ram
|
|
|
|
|
You are not actually calling OnDestroy() yourself are you? OnDestroy() is a message handler that is called by the system when the window recieves a WM_DESTROY message. Call DestroyWindow() instead.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Hi, All
I want to make my dialog same
+---------------------------------+
| MyDialog
| +-------------+ +---------+
| | Common Dlg | | My Items|
| | CColorDialog | | My Items|
| +-------------+ +---------+
|
+---------------------------------+
do you have any idea?
Thanks for read.
-- modified at 19:36 Thursday 29th June, 2006
|
|
|
|
|
What I get from your question is that you want to show one dialog twice on another dialog.
Am I right?
Do this way
Declare CMyDialog dlg1,dlg2 in the header file of your class where you are calling the dialog.
dlg1.Create (IDD_TEST_DIALOG1,this);
dlg1.SetWindowPos(NULL,0,0,100,100,SW_SHOWNORMAL );
dlg1.ShowWindow (SW_SHOW);
dlg2.Create (IDD_TEST_DIALOG1,this);
dlg2.SetWindowPos(NULL,100,100,100,100,SW_SHOWNORMAL );
dlg2.ShowWindow (SW_SHOW);
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
<br />
CYourClass m_yourclass;<br />
m_yourclass.Create(IDD_YOURCLASS,0)<br />
m_yourclass.ShowWindow(1);<br />
and ...<br />
whitesky
|
|
|
|
|
I ran into a problem after implementing a simple algorithm that checks for the longest common sequence in a string of characters. After implementation, I tested the algorithm and everything worked fine, but since I needed to use the output as input in other programs I decided to save the output to a text file. But I was suprised that the output was saved in a format that is not human readable.
Could anybody please tell me what I need to do to get the output saved just as it appears on the screen(human readable form).
By the way I used MS CString class in the implementation.
The screen output is:
UPWARDS UPWARDS UPWARDS DIAGONALWARDS LEFTWARDS DIAGONALWARDS
DIAGONALWARDS LEFTWARDS LEFTWARDS UPWARDS DIAGONALWARDS LEFTWARDS
UPWARDS UPWARDS DIAGONALWARDS LEFTWARDS UPWARDS UPWARDS
DIAGONALWARDS UPWARDS UPWARDS UPWARDS DIAGONALWARDS LEFTWARDS
UPWARDS DIAGONALWARDS UPWARDS UPWARDS UPWARDS UPWARDS
UPWARDS UPWARDS UPWARDS DIAGONALWARDS UPWARDS DIAGONALWARDS
DIAGONALWARDS UPWARDS UPWARDS UPWARDS DIAGONALWARDS UPWARDS
This is the same output saved to file.
00422E2C 00422DEC 00422DAC 00422D6C 00422D2C 00422CEC 00422CAC 00422FEC
004215EC 004215EC 004215EC 0042175C 004217AC 0042175C 00422FAC 0042175C
004217AC 004217AC 004215EC 0042175C 004217AC 00422F6C 004215EC 004215EC
0042175C 004217AC 004215EC 004215EC 00422F2C 0042175C 004215EC 004215EC
004215EC 0042175C 004217AC 00422EEC 004215EC 0042175C 004215EC 004215EC
004215EC 004215EC 00422EAC 004215EC 004215EC 004215EC 0042175C 004215EC
0042175C 00422E6C 0042175C 004215EC 004215EC 004215EC 0042175C 004215EC
Any help will be greatly appreciated
|
|
|
|
|
Your file writing code is writing pointer values - probably the values of the LPCTSTR pointers kept inside the CString s. You need to write the characters themselves.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Hello,
I am using the following to pull the domain/workgroup name of a remote computer. This works just fine when I use the remote computers IP address but if I use the machine name it fails with an access is denied error. Has anyone experienced the same problem or does anyone have any ideas why this is happening?
DWORD dwLevel = 100;
LPWKSTA_INFO_100 pBuf = NULL;
NET_API_STATUS nStatus;
nStatus = NetWkstaGetInfo(L"\\\\192.168.1.2", dwLevel, (LPBYTE *)&pBuf);
if (nStatus == NERR_Success)
{
TRACE(L"Name:\t\t%s\n", pBuf->wki100_computername);
TRACE("Platform:\t%d\n", pBuf->wki100_platform_id);
TRACE(L"Domain:\t\t%s\n", pBuf->wki100_langroup);
}
else
{
char error[1024];
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, nStatus, NULL, error, sizeof(error), NULL);
TRACE("Error: %s", error);
}
if (pBuf != NULL)
NetApiBufferFree(pBuf);
Thanks,
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
RobJones wrote: ...but if I use the machine name it fails with an access is denied error.
Your code snippet works fine for me using either an IP address or a machine name. How are you specifying the machine name?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I specify it like.... L"\\\\machine". I'm going to test it at work today on a few other machines. Just thought it was weird that simply switching between IP and machine name would cause that error.
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Makes me wonder if it's a name-resolution issue. Do you have a problem using gethostbyname() ? In other words, can you use this function to resolve a host name to its IP address?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi All,
I need to cath notify messages from a slider control and I can't seem anything specific to slider controls.
i.e. When the user slides the thumb, I'd like to make adjustments to other parts of the program. Such as changing text color.
Can anyone help?
Ferdinand
|
|
|
|
|
|
Hi everyone!
Here I go again...;)
I'm writing a simple win32 console program.
so, I'm trying to open a text file that has the following in it:
0x00
0x01
0x02
0x03
0x04
0x05
0x06
0x07
What I want to do is open the file then get the data and stick it into an array of CString or whatever. i.e. data[0] = 0x0, data[1] = 0x1, etc.
Here is my code:
<br />
#include "stdafx.h"<br />
<br />
int _tmain(int argc, _TCHAR* argv[])<br />
{<br />
char *data[200];<br />
FILE *fpread;<br />
int i = 0;<br />
<br />
if ( (fpread = fopen("data.txt", "r")) == NULL )<br />
{<br />
printf("Cannot open file for reading. \n");<br />
return -1;<br />
}<br />
<br />
for ( int a = 0; a < 200; a++ )<br />
{<br />
data[a] = "q";<br />
}<br />
<br />
while( (feof(fpread) == 0 || ferror(fpread) == 0) )<br />
{<br />
fscanf(fpread, "%s", &data[i]); <- problem is here... i think<br />
printf( "data = %s \n", data[i]);<br />
i++;<br />
}<br />
<br />
if (feof(fpread) != 0)<br />
{<br />
printf("EOF\n");<br />
}<br />
else if (ferror(fpread) != 0)<br />
{<br />
printf("error!\n");<br />
}<br />
<br />
return 0;<br />
}<br />
When I run my code I get:
Unhandled exception at 0x0059f89f in testFileOpen.exe: 0xC0000005: Access violation reading location 0x30307830.
then it opens up the file: output.h and says that it has a problem with line 1646.
please explain....
Kitty5
|
|
|
|