|
I am not sure how to do this in MFC, but I *think* you need to modify what you posted in order to use fstream.
Try....
ifstream myStream;
myStream.open("c:\test.txt");
if ( myStream.fail() )
{
MessageBox("Failed!");
}
else
{
MessageBox("Opened!");
}
- John
- johnu@emersonprocess.com
|
|
|
|
|
|
Hi, how can I play sound on the internal PC speaker?
Like an sweep up od down, or anything else...
It ist possible, because if you know WinAce 2.0 : When you extract an large ace-file and the extraction is complete the pc-speeaker goes "dililililip"
So how can I do so?
Thankz
Ken
|
|
|
|
|
> the pc-speeaker goes "dililililip"
They probably are using the Beep API function. It takes the frequency and duration as params.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
maybe, but this only works on Win2k /NT...
ther must be a basic (C language or so... a MSDOS working function) way to play sound on speaker...
Any idea?
Ben
|
|
|
|
|
How make to exit or modify a no-static variable inside a static CallBack function MidiInProc(declared in mmsystem.h)when i receive MIM_DATA MIDI Message. i define my static callback inside a class and called in midiInOpen.. Please help me
|
|
|
|
|
hi all,
could anyone tell me the character and the use of "static member function" in a class? i found that AfxBeginThread() need to pass only a static function in the new thread? any reason for that?
thanks,
jim
|
|
|
|
|
We had an interesting dicussion on this a while back - type 'casting thread' into the keyword filter box to locate.
This should be in the FAQ
|
|
|
|
|
hi Tim,
i can't locate and message with 'casting thread'... could you check this out for me?
regards,
jim
|
|
|
|
|
I think its here
Basically, member functions have an extra param tacked on - the this pointer - which means they can't match the callback's signature - static members don't have this problem, but can't access non-static member vars - the other thread has the whole story, and more!
|
|
|
|
|
I am using Dundas HyperView Studio ActiveX forms in an application. The forms work very well except for one problem I have encountered which is causing my customers (and me) quite a headache.
Just for reference: The application is an MFC MDI application using StingRay Objective Toolkit and Dundas HyperView studio together. I am using VC 6.0 Enterprise edition w/SP 5. The problem occurs on Win95, 98 and 2000. I have not tested it on NT or ME.
I have a a document which has a split frame with 2 sections (top and bottom). On the top frame I have a view in which I create (at run-time) a tab control. Each tab on this control corresponds to a different modeless dialog which is created on-demand. Presently there are 3 tabs. 2 are simple VC dialog resources displayed as modeless dialogs. The 3rd is a VC resource modeless dialog with a Dundas HyperView form created on it.
Everthing works fine except if the hyperview form is displayed and the user minimizes the app or ALT+TABs out, the user cannot ALT+TAB back or simply click the icon on the task bar. The only way to get back is to R-Click on the task bar and choose "Restore". This only happens with the hyperview forms, not the other modeless dialogs displayed.
If anyone has any experience with this problem, please respond.
Thanks in advance.
|
|
|
|
|
I am attempting to nest a CPrintDialog on another dialog window. Although I have been able to do this already for CFileDialog, it seems that something needs to be done differently for the print. Has anyone nested the CPrintDialog and can anyone provide sample code? Thanks.
-Andrew
|
|
|
|
|
From the MSDN:
"For all common dialog boxes except the Explorer-style Open and Save As dialog boxes, you modify the default template to create a custom template that replaces the default template. The custom template defines the type and position of the standard controls as well as any additional controls."
You can find the default template in the file PRNSETUP.DLG located in your vc\include directory.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
I'm writing a custom AppWizard and have some problems customizing the projects that it generates. How do I add lib files to the linker settings? I guess I should override CCustomAppWiz::CustomizeProject() and manipulate the IBuildProject* parameter, but I can't find a good explanation on how to do this. Any ideas?
--------------
"Fabricati Diem, Pvnk"
|
|
|
|
|
I want to store my data in an xml file and have operations of file
new,open and save.I am coding in vc++ and not using CObject class which takes care of these default.How can I achieve this?
Thanks in advance.
Pathi
bhikshapathi_g@semanticspace.com
|
|
|
|
|
Yeah, I know you guys get this one a lot, I've seen them...
But I have another instance of a program running fine in debug and crashing in release.
I have set up a configuration that basically mimics as many settings of "release" as possible, but allows me to go through in debug mode and trace code. Ok, here we go:
I have a dialog app.
The main dialog (we'll call it Dialog A) that opens has a button on it that results in opening Dialog B. Upon clicking this button I get an error of:
"The instruction at '0x004229dd' referenced memory at '0x00000401'. The memory could not be 'read'."
So I traced it. It occurs AFTER the DialogB::OnInitDialog() call.
This is a screenshot of the debug window showing where it 'died'
ftp://cabadam.homeip.net/sshot.jpg
I am unable to determine why it crashed, maybe one of you guys could help me out.
Thanks!
Adam
cabadam@houston.rr.com
|
|
|
|
|
m_pCtrlSite contais bogus value. Looks like you're overwriting it somewhere. Do you have access to diagnostic tools like BoundsChecker or Purify?
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hi All:
I´ve an aplication and I want to pass data between VC++ and VB, in this direction. How could I do it? Thanks
|
|
|
|
|
What kind of data and how much?
You could create a Simple object with the ATL app wizard, VB could create the object and the C++ app could pass its data via the object's properties.
Michael
|
|
|
|
|
I need pass strings asyncronous. Cuold you give me more details abuot it?
Thanks.
|
|
|
|
|
So when the string gets updated in your VC app you want VB to be notifed and pass the new string?
If this is what you want, you need to define a COM interface in your VC app and make uses of the Implements functionality of VB. The VC app then calls the VB implementation of the interface when it needs to notify VB of a change.
How much COM have you done before? The following articles will probably explain things better than I can
http://msdn.microsoft.com/library/default.asp?URL=/library/welcome/dsmsdn/drgui102599.htm
http://www.codeproject.com/com/connectionpoints1.asp
http://www.codeproject.com/com/connectionpoints2.asp
Hope this helps
Michael
|
|
|
|
|
I didn't understand ...
It means, for example if i create the ActiveX by MFC ActiveX, may be my control don't run in other programming language ?!!! (For example in VB ?)
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hi,
You can use BSTR I think I saw an article on this technique in MSDN.
Good luck,
Dror
|
|
|
|
|
I want to pass data from VC++ application to VB GUI. For VB comunication to VC++ I have created a dispinterface with COM but now I need to create a dual interface with COM and I know how to do it? Thanks.
|
|
|
|
|
I want to be able to control printing to some print queues by
manipulating the spooler files directly. There are two files in a print
job: The .SPL file (which is the actual print job) and the .SHD file
(Shadow file). The .SHD file is the header file with all information about
the print job (User/Name/size/etc...).
Does anyone know what the file format for the .SHD file is? Or can
anyone point me to a location to look for the file structure definition?
Grtx,
Berry
|
|
|
|