|
|
The second version wants a subclassed CWinThread, but I'm not sure where exactly to place my code in it. May be in InitInstance. Any suggestions?
I already have the worker thread and the code for it, I need to know what to change to make showing modal CDialogs possible.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
The second link shows common CWinThread overrides
and what those overrides should do.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Sorry, I didn't notice it. Thanks.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hi.I'm using visual c++ 9.0.
I want to do something like this:
string name = get_name();
string filename = name+("text.dat");
ifstream infile_file;
infile_file.open(filename);
(code)
(...)
I'm doing something wrong... or I am missing something.
Here is the error:
error C2664: 'void std::basic_ifstream<_Elem,_Traits>::open(const wchar_t *,std::ios_base::openmode,int)' : cannot convert parameter 1 from 'std::string' to 'const wchar_t *'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Thanks.
"Failure is always an option."
|
|
|
|
|
this is because you're building your appblication in UNICODE most probably...
try removing the declaration of that macro and rebuild.
forget that. std::string::c_str() is the way to go
modified on Wednesday, September 3, 2008 11:05 AM
|
|
|
|
|
I did remove the declaration in progect properties.. but didn't work...
But thanks anyway for your help.
"Failure is always an option."
|
|
|
|
|
yeah, after reading David's Answer, I figured out my mistake...
|
|
|
|
|
FrankMookie wrote: infile_file.open(filename);
Try:
infile_file.open(filename.c_str());
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
it worked just fine withinfile_file.open(filename.c_str()); . Thanks alot!
"Failure is always an option."
|
|
|
|
|
Hey,
i've written a simple ActiveX-Control which shows a Dialog (CDialog) with some CEdit Controls. All works fine in TestContainer, but when I us the control for e.g. in Excel (2003, 2007) i can't write text to my edit controls. All text is shows on my worksheet.
Help me please...
|
|
|
|
|
Hello,
i need to get data from an Excel sheet, which is saved as xlsx file.
Is it possible to access a xlsx file over CDaoDatabase and CDaoRecordset like the old xls excel files?
Thanks,
Andy
|
|
|
|
|
Andy@ wrote: Is it possible to access a xlsx file over CDaoDatabase and CDaoRecordset like the old xls excel files?
If the xlsx file is an XML file then probably not.
Do you have a C++ or MFC question?
led mike
|
|
|
|
|
The code base i use is MFC, with a class that get the Data from the xls Excel format over the MFC classes CDaoDatabase and CDaoRecordset.
I wrote this some times ago. Now i need to handle the new format of xlsx files.
I thought that xlsx is always XML, but i´ve now opend the xlsx file with a hex editor and it seems to be a bin file.
I need a hint or a solution how i can get data from the xlsx file over MFC or Visual C++.
regards,
andy
|
|
|
|
|
Andy@ wrote: The code base i use is MFC, with a class that get the Data from the xls Excel format over the MFC classes CDaoDatabase and CDaoRecordset.
I wrote this some times ago. Now i need to handle the new format of xlsx files.
I don't know if DAO will work but here is some information about using OLEDB/ADO[^]
led mike
|
|
|
|
|
thanks for the hint,
andy
|
|
|
|
|
My Requirement is .
When pressing the start button in My Dialog . the window is minimized.
then the user click and Drag on the screen.
after the drag operation i want to get the selected area.
the selected area is anywhere in the screen.
Also i want to indicate the user about his selection through a marking Rectangle while the Drag Operation.
i am tried the following code
m_bDragging = TRUE;
::SetCapture( ::GetDesktopWindow());
and Mapped the OnMouseMOve Function of my Dialog.
But it did not Work.
Can Anyone help me.
|
|
|
|
|
Can you check this article to do mouse capture?
http://www.codeproject.com/KB/DLL/PasswordSPY.aspx
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
You won't get any WM_MOUSEMOVE messages in your dialog if you've set
capture to another window.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi All
I want to copy file data from Source to destination.I have information about Source file path and Directory path.Can any one give me example. Plz help me
|
|
|
|
|
what about using CopyFile() ?
|
|
|
|
|
See here[^]
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
|
Thx's for Responce..It's helping me..
But i need more information
My Source File Name is Store in String strFileName.
void OnCopy(const CString & strFileName)
{
m_listBox.AddString( _T("File Added: ") + strFileName);
CopyFile(strFileName, "C:\\New Text Document.txt",FALSE);
}
i want to do in this formate..
So plz help me..
Thx's in advance..
|
|
|
|
|
Isn't it working? Any errors?
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|