|
Thanks Rajkumar
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Well see this code
Mynamespace.Myclass.MyMythod a=new Mynamespace.Myclass.MyMythod();
but if you use of #using you will have this code:
#using Mynamespace
Myclass.MyMythod a=new Myclass.MyMythod();
|
|
|
|
|
I have created the Test SDI application with MfcAppWizard(exe).
I run the appication an it's showing me default window.
It has default window color as RGB(192,192,192). But I want to change it to some different color for better look.
How can I change it's defauld color for my application so that all window forms, dialog boxes, tool bars, menus, etc having some new default colors like sky blue or somthing else.
Please help me regarding this.
|
|
|
|
|
I guess you have to handle it separately for every window by handling WM_CTLCOLOR.
Regards,
Sandip.
|
|
|
|
|
You can use o WM_CTLCOLOR however you can use of WM_PAINT or WM_ERASEBK...
|
|
|
|
|
Hi all,
I want to write a xml file to send some data. What I tried is write data to a temporary file, then attach it to a buffer and do the processing.
long CCreateXML::CInitialElements(void)
{
TCHAR szTempFile[MAX_PATH];
HRESULT hr;
CComPtr<istream> pOutFileStream;
if(!::GetTempFileName("C:\\", "rf", 0, szTempFile))
{
return -1;
}
if(FAILED(hr = SHCreateStreamOnFile(szTempFile, STGM_CREATE | STGM_WRITE, &pOutFileStream)))
{
return -1;
}
return 0;
}
</ixmlwriter></ixmlwriteroutput></istream>
I got a link error at the beginning and wried it me. Can you guys tell me where I'm going wrong.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
CodingLover wrote: I got a link error at the beginning
Providing the exact error message would be helpful
I would guess your project needs to link to shlwapi.lib to use
SHCreateStreamOnFile().
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
In my simple MFC application, there are two controls, one button and multi lien edit box
The event handler of the button will do the parsing of some files(aboutt 100 files) which may take about 10 minutes to complete. And during the parsing time, I want to list the file name which being parsed in the edit box which is being created with ‘multiline’, automatic horizontal and vertical scroll bar options.
It is working well.
I also like to have the option that the user can operate the UI while the parsing is in progress, for that, I added the following code fragment in the file parsing ‘for’ loop in the event handler of button.
MSG msg;
while(::PeekMessage(&msg, NULL, 0,0, PM_REMOVE))
{
::TranslateMessage(&msg);
::DispatchMessage(&msg);
}
Still every thing is working fine, except that when I click on the vertical scroll button(this scroll bar comes when the items can not be accommodate in the edit box) of the edit box, PeekMessage became in a waiting state and can get the message only after the left mouse button is realese for the scroll bar. During the waiting time of PeekMessage the file parsing is paused. I want to solve this issue such that parsing is performed even when the user operate on the Vertical scroll bar of the edit box.
The event handler of the button look like :
void CMyDlg::OnBnParseFiles()
{
for(int nFileIndex = 0; nFileIndex < 1000; ++nFileIndex)
{
//Perform the parsing on the file with the specified index
PerformFileParsing(nFileIndex);
//Upadate the list of parsed files in the Edit control
UpdateEdit();
MSG msg;
while(::PeekMessage(&msg, NULL, 0,0, PM_REMOVE))
{
::TranslateMessage(&msg);
::DispatchMessage(&msg);
}
}
}
Plese help me if any one any idea
Thanks
Prasanth
|
|
|
|
|
A better design would be to do your parsing loop in a separate thread.
It sounds like when the scrollbar gets the mouse down message it enters a
modal loop until the button is released, so there's no (easy, anyway) way
to continue your loop on the same thread.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have a question why you dont use of ListBox instead editbox?
|
|
|
|
|
Hi,
I have a class which is derived from CObject. Now i want to add print support for this class. Hos is it possible? Is there anyway.
Thanks,
|
|
|
|
|
To Use MFC Printing support i guess your class should be derived from CView.
Regards,
Sandip.
|
|
|
|
|
The problem is it is legacy graphic custom control developed in VC++ derived from MFC. Now i have to add print support for this. I am searching in google. but so far i am unlucky. Is there anyway to add print support.
Regards, Eswari
|
|
|
|
|
May be you can add a wrapper/container class to your control which you can derive from CView and add printing support to it.
Regards,
Sandip.
|
|
|
|
|
Do you want to print your datas ?
|
|
|
|
|
Hello dear friends,
I ve an application in which I use the VC6.0.
In the application i have used a C# dll's .tlb file.For creating the
setup for this application what should be done.I am asking about what
should I do to distribute the .tlb file.
Thanks in Advance to all of you.
ritz1234
|
|
|
|
|
Hi all,
I have a DWORD variable like this,
DWORD value = 0;
After checking a condition, I want to set all bits to 1. If I do this,
DWORD value = 0xffffffff;
is that ok?
I appreciate your help all the time...
CodingLover
modified on Monday, June 2, 2008 12:29 AM
|
|
|
|
|
CodingLover wrote: After checking a condition, I want to set all bits to 1. If I do this,
DWORD value = 1;
Since DWORD is unsigned long , assigning -1 will do the trick.
DWORD value = -1;
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Actually I put DWORD = 1 by my mistake.
Can you see my edited post.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
There is nothing wrong, but instead of hardcoding, you can use constants such as MAXDWORD which is defined in winnt.h or ULONG_MAX which is defined in limits.h . That will be more safe.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Thanks a lot. Now I got the point.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
hello, everyone:
i am now in trouble with the code below:
char temp[256];
LONG cbData=80;
RegOpenKeyEx(...&hKey);
RegQueryValue(hKey,NULL,(LPTSTR)temp,&cbData);
strcat(temp,"\\abc");
with the last line above , i could only retrieve the first charactor in temp,and the result is just *\abc. I am confused....is there anyone could help me?Thanks in advance~
modified on Monday, June 2, 2008 12:32 AM
|
|
|
|
|
steven_wong wrote: strcat(tem,"\\abc");
tem or temp ? Just a typo while framing the question or some other temporary variable?
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
temp,i am sorry
|
|
|
|