|
CString strFile = "theFile.txt"
std::ifstream SourceFile(strFile);
char buffer[50];
while (!SourceFile.eof() && ::PathFileExists(strFile)) {
SourceFile.getline(buffer, sizeof(buffer));
if ( ) {
}
}
SourceFile.close();
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Respected Toxcct
Regards!
Thanks for response, but now how i can proceed in
if(.....)
i dont know that how i write the condition in my case, so plz push me.
Waiting for + response.
|
|
|
|
|
Hi,
I would like to know the role of IMPLEMENT_DYNAMIC,IMPLEMENT_SERIAL & IMPLEMENT_DYNCREATE macros in mFC.
I very well know that they are used for Dynamic Creation of objects,Accessing runtime information and for Serialization. But I want to know how these macros help in this? Can anyone please give me some link to articles where I can find this information.
Thanks
Madhavi.
|
|
|
|
|
Hi!
Can someone please help me how to write a button control that can be dragged and dropped?
I want to drag the button from one side of the Dialog to the other.
I'm doing this to learn.
Thanks!
|
|
|
|
|
reposting the same question[^] will cause the same answers...
if no one answered much is because :
1) the question is not clear enough
2) no one knows
3) what has been answered performs you enough infos for you to do it !
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hello,
I created a extended TabCtrl from CTabCtrl. Then subclassed it to a CPropertySheet. The problem is after I select any other page in the propertysheet, it will get hanged on activate or deactivate other windows which make my program to do repaint.
If the page has no controls on it, there is no problem.
The creation of propertysheet is as follows:
m_pPropSheet = new CPropSheetEx("",this);
m_pPropSheet->AddPage(&m_page3);
m_pPropSheet->AddPage(&m_page2);
m_pPropSheet->AddPage(&m_page1);
m_pPropSheet->Create(this,WS_CHILD|WS_VISIBLE);
In CPropSheetEx (the derived class), I use the following to subclass the tabctrl:
BOOL CPropSheetEx::OnInitDialog()
{
BOOL bResult = CPropertySheet::OnInitDialog();
CTabCtrl* pTabCtrl = GetTabControl();
m_tabctrl.SubclassWindow(pTabCtrl->GetSafeHwnd());
return bResult;
}
I did override OnPaint() of the CTabCtrl in my derived CTabCtrlEx to draw my special tab styles.
Can anybody help me, please?
Thank you!
|
|
|
|
|
Sorry, I didn't understand this part:
Nishad S wrote:
it will get hanged on activate or deactivate other windows which make my program to do repaint
Can you clarify it?
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Suppose my program is running top of all windows, when I minimized and then restore any other window over my program's window, then my program will get hanged.
I think it causes the complete redraw of my program's window.
It is also get hanged when I activate another window over my window completely and then reactivate my window.
In short, I think, my program gets hanged when the window is completely redrawn.
If there is no controls on the page, no problem!
|
|
|
|
|
I found the following...
When I create the propertysheet by DoModal() there is no problem!
Also the following code is also fine:
m_pPropSheet = new CPropSheetEx("");
m_pPropSheet->AddPage(&m_page3);
m_pPropSheet->AddPage(&m_page2);
m_pPropSheet->AddPage(&m_page1);
m_pPropSheet->Create();
But the propertysheet comes in a new window, which I cannot allow!
|
|
|
|
|
all the problems I have had with hanging Property Sheets has been due to this[^]
Steve
|
|
|
|
|
Thank you!
I tried, but the problem is still exists.
|
|
|
|
|
I'm just guessing here, but try adding clipping styles to the sheet window:
m_pPropSheet->Create(this, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
Also, you might temporarily comment the tab control subclassing so as to determine if the problem is related to the tab control or not.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
I have a VC6 project I am moving to VS2005 ( I did not write it ). I've just finished all the compile errors, but the link errors have me beat. I moved a lot of code from nonstandard headers to headers like iostream, fstream and string. I've put using statements in, obviously.
I'm getting a ton of these:
Error 58 error LNK2001: unresolved external symbol __imp_??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z dcmjpeg.lib
It's very possible that these errors are from linking against other libraries, which may also use the old headers.
It's a long time since I've been this involved in a C++ project, and I have to say that while most of it has come back easily, on this I'm stumped. Any advice appreciated.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Not an answer, but some time questions still help
The error mentions dcmjpeg.lib (part of the DICOM Toolkit, I guess.) Do all of the errors come from dcmtk libraries?
Are you compiling those libraries from the sources or using distributed binaries? If the former, are you sure they are being compiled with the same settings as the rest of your project? If the latter, maybe you need a newer version?
You might get something at comp.protocols.dicom...
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Thanks - I just worked out that some of my libraries were from the DICOM stuff, and went looking for a newer version. No, I'm not building the library. I just inherited this project in the last few weeks, and my first recommendation was a move to a newer compiler than VC6, which forced fixing all the non standard C++ in the project ( methods with implied int/no return statements, base classes with pure virtual methods that were not implimented in all derived classes, etc ).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
I just inherited this project [...] methods with implied int/no return statements
I hope whoever wrote those methods isn't at the reach of your hands
Christian Graus wrote:
base classes with pure virtual methods that were not implimented in all derived classes
But these couldn't be instantiated even in VC6, right?
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Jose Lamas Rios wrote:
I hope whoever wrote those methods isn't at the reach of your hands
LOL - actually, I started in that frame of mind, but he's a vet who learned C in uni 10 years ago, and ended up on this project. He's pretty open to learning how to do things properly, and he's a nice guy. I think he may have been the wrong guy for the job, but it's too late to change that now.
Jose Lamas Rios wrote:
But these couldn't be instantiated even in VC6, right?
Imagine my disgust, but I'm afraid VC6 was compiling this code.
FWIW, I got the latest library, and it's clear it's been updated. The old version contains a file called ofstream.h (!). It includes pretty much every non standard header I can think of, and seems to me to add to the original ofstream.h. I can't imagine why else it's there, and it certainly has comments to say people have been adding to it. Bloody hell.
I never seem to charge enough for this sort of work....
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
I am Prasannajit Dash,created one NT Service in ATL Wizard and also created
another COM Dll through ATL. I tried to call the COM Dll before the _Module.Start function in the _tWinMain() function of the Service. I could not able to see the CoCreateInstance() gets succeeded. I do not know what could be the reason behind the call so that I am not able to get the interface pointer back.
|
|
|
|
|
|
Yes, I am calling CoInitialize(NULL) before CoCreateInstance() API.
hr = CoCreateInstance() retunrs -2147024809, not 0.This is what I am replying
to you. Please help me how to handle this problem.
|
|
|
|
|
-2147024809 == 0x80070057 == E_INVALIDARG == Invalid Argument.
Post some code to see how you are calling CoCreateInstance.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
#include "..\\NTServiceDLLOne\\NTServiceDLLOne.h" //Headers for IDllNtServiceCOM
#include "..\\NTServiceDLLOne\\NTServiceDLLOne_i.c" //For CLSID_and IID
CoInitialize(NULL);//Initialize COM Library
IDllNtServiceCOM* ppInterface = NULL; //COM Dll Interface Pointer
HRESULT hr = CoCreateInstance(CLSID_DllNtServiceCOM, NULL, CLSCTX_INPROC_SERVER, IID_IDllNtServiceCOM, (LPVOID*)ppInterface);
BSTR bstring = L"Hello World";
LPUNKNOWN punk = NULL;
hr = ppInterface->ShowMessageBox(bstring, &punk); //
hr = ppInterface->Release(); //Releasing interface pointer
CoUninitialize(); //Uninitialize COM Library
_Module.Start();
|
|
|
|
|
ppInterface is an interface pointer. You need to pass a pointer to the pointer so that CoCreateInstance can load a value in it.
Instead of:
IDllNtServiceCOM* ppInterface = NULL;
HRESULT hr = CoCreateInstance(CLSID_DllNtServiceCOM, NULL,
CLSCTX_INPROC_SERVER, IID_IDllNtServiceCOM, (LPVOID*)ppInterface);
It should be:
IDllNtServiceCOM* pInterface = NULL;
HRESULT hr = CoCreateInstance(CLSID_DllNtServiceCOM, NULL,
CLSCTX_INPROC_SERVER, IID_IDllNtServiceCOM, (LPVOID*)&pInterface);
if (SUCCEEDED(hr))
{
}
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Hi all,
I have a quick question which I hope someone can help me solve easily. I have a legacy system to maintain which combines WinBatch (a windows scripting language) and Visual C++ 6 applications.
We have a WinBatch script which starts up our Visual C++ appliactions. These apps then create global sections of memory, mutex objects etc. The app then later kicks off another WinBatch script. Seems pretty simple...
The problem we are facing is that the script that is kicked off by the application inherits the process space of the parent application that called it. i.e. it has in its address space handles to the global sections of memory etc that belong to the parent etc. This causes us some grief later down the track.
My question is that is there a way to spawn off a sub process in VC++ 6 that does not inherit from the parent? The system was originally coded using the win32api system call, and I have also tried the _spawnl call, but to no effect.
Hopefully I have just missed something really obvious here.
Many thanks,
Tony.
|
|
|
|
|