|
how we can add total path.here we are ading only file name.
if we want to add we use Folder+Filename.but in between we need"\".if adding this by Folder+"\"+Filename.it showing a error so how we can add.
ram.
|
|
|
|
|
i wrote for you a sample that insert path+file did you saw.
whitesky
|
|
|
|
|
WhiteSky wrote: i wrote for you a sample that insert path+file did you saw.
But you did not save the code snippet to his computer and then start the compiler. You were basically just no help at all!
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
See this
<br />
CFileFind finder; <br />
BOOL bWorking = finder.FindFile(_T("*.*")); <br />
while (bWorking) <br />
{ <br />
bWorking=finder.FindNextFile(); <br />
if (finder.IsDots())<br />
continue; <br />
if (!finder.IsDirectory())<br />
m_List->AddString((LPCTSTR) finder.GetFileName()); <br />
}<br />
whitesky
|
|
|
|
|
|
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
|
|
|
|