|
Hi all,
I have written a xml file writer application and all data written into a disk file.
I refer the following example to do it.
http://msdn.microsoft.com/en-us/library/ms753144(VS.85).aspx[^]
Now I want to read that disk file in to memory. I mean to a buffer. Because I want to attach it with another data buffer.
How can I do this.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Hi all,
I have written a xml file writer application and all data written into a disk file.
I refer the following example to do it.
|
|
|
|
|
Hi,
In a SDI Application, I have three Classes CMainFrame, CLeftView(Derived from CTreeView)
and CMyPrgView(Derived from CFormView).
Now I want to access all class member, function and control variables of each class from rest of classes.
Like when I click on tree items(LeftView), Controls placed on FormView should respond
or
clicking on menu(MainFrame) both TreeView items and Formview controls respond and vice versa.
Please tell me any standard way to access other class members and function in SDI Application.
Regards,
Maxim.
|
|
|
|
|
Write your controling function in Application class (Derived from CWinApp).
class CYourApp : public CWinApp
{
public:
void YourControlingFunction();
}
CYourApp* pApp = (CYourApp*)AfxGetApp();
if(NULL != pApp)
{
pApp->YourControlingFunction();
}
Hope this will serve your purpose.
Regards,
Paresh.
|
|
|
|
|
Thanks for your reply. I tried following code in my CLeftView class on Tree item selection(OnTvnSelchanged ).
CMyPrgView* pView= (CMyPrgView*)AfxGetApp();
if(NULL!=pView)
{
pView->m_Edit1.SetWindowText(L"P");
} But getting "Debug Assertion Failed" error on SetWindowText() .
|
|
|
|
|
The AfxGetApp() will return your application class poniter not view. Here you have casted the AppClass to ViewClass poniter. This is not possible.
akt
|
|
|
|
|
I did it as suggested by "Paresh".
I have also tried CMyPrgView* pView = new CMyPrgView();
but still Assertion error comes.
What i do, please suggest me.
|
|
|
|
|
Please read my post carefully. Take the help of AfxGetApp[^].
Regards,
Paresh.
|
|
|
|
|
You can have pointers to your view classes inside CMainFrame.
and then access through AfxGetMainWnd() which will giev you pointer to CMainFrame.
you have to typecast i.e. (CMainFrame*)AfxGetMainWnd().
I home it makes sense.
Regards,
Sandip.
|
|
|
|
|
I have a file dialog.i have filtered out the type of file i need.but how could i open the file in the application after selecting it?after clicking "open" in the dialog , i need to see the file.
Thanks
|
|
|
|
|
ShellExecute(/*parameters*/); will open the file in the application that it is related with. You will have the file path from the FileDialog
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I have to just display a jpeg file from the selected folder.No other operation has to be done.What should I do?
|
|
|
|
|
So, did you try opening the file using ShellExecute? Where do you want to display the jpeg file. look at the parameters of the ShellExecute function. You can pass the name of the application that you want the file to open in. Hope this helps.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thank you Sir....
I was able to open the jpeg file now.Now I want to know what should I do to open an exe file?should i just specify the path of the exe file?
|
|
|
|
|
Yes. BTW you can take some time out and visit MSDN site for more help on ShellExecute and how to use it.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
the jpeg files which i have specified to be opened is displayed in Windows picture and fax viewer.Anything that i have to do to just diaply the picture in vc++ runtime display.
here is the code i have written
ShellExecute(NULL,"open",f.GetFileName(),NULL,NULL,SW_SHOW);
|
|
|
|
|
That would be the default associated application in the registry settings [Don't recollect where exactly] for jpeg files.
projectip wrote: do to just diaply the picture in vc++ runtime display.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thank you so much for your help....
|
|
|
|
|
You are most welcome
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Using C++ program I want to place the cookie in the users cookie folder (C:\Documents and Settings\Administrator\Cookies) by creating a cookie file. I know how to create a file, but placing the cookie in the users cookie folder (C:\Documents and Settings\Administrator\Cookies) is the problem. As when I saw my cookie folder, files are named with user "name@filenale.txt" (ex:administrator@codeproject[1].txt).
So can any one give me tips in placing the cookie file in the cookie folder with the above mentioned file naming style.
Nandu
|
|
|
|
|
|
|
Can we avoid sorting of CComboBox programmatically?
Thanks & Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
Take a look at SetClassLong() function ...
|
|
|
|
|