|
Iain Clarke wrote: try using a more helpful subject than "hi". Though it's polite at least
Subject: hi Iain
|
|
|
|
|
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
[My articles]
|
|
|
|
|
What kind of window you are creating?
If it is a predefined window (like, edit, static, etc.) then there are specific ways for that.
If not, you can use SetClassLong with GCL_HBRBACKGROUND to change the background color.
|
|
|
|
|
Hi All
I am useing VC2005.When i build the code then i am geting this error .Plz help me
\program files\microsoft visual studio 8\vc\platformsdk\include\windef.h(176) : fatal error C1083: Cannot open include file: 'winnt.h': No such file or directory
|
|
|
|
|
MsmVc wrote: Plz help me
Sure why not. If you don't know how include files work then you need better study material for learning how to program in C/C++. You are using one or more books that are introductions to C/C++ to learn from yes?
led mike
|
|
|
|
|
Hi,
I have a application that communicates with server (Java) and communication is done using SOAP. I am able to communicate properly as much as I can in DEBUG mode but the same code is not running in RELEASE mode.
There is one function (freememory(PBYTE&)) which we are calling to free the memory. this works fine in DEBUG mode but not in RELEASE. if I put message box in this function then it is working fine.
Please suggest I do not want to use messge box.
Thanks
SNI
SNI
|
|
|
|
|
|
SNI wrote: I am able to communicate properly as much as I can in DEBUG mode but the same code is not running in RELEASE mode.
See here.
"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
|
|
|
|
|
void CTestView::OnPaint()
{
CPaintDC dc(this); // device context for painting
Invalidate(FALSE);
}
void CTestView::OnDraw(CDC* pDC)
{
CTestDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CFont font;
font.CreatePointFont(20, "Garamond");
CFont *pFont = pDC->SelectObject(&font);
pDC->TextOut(20, 18, "Christine", 9);
pDC->SelectObject(pFont);
font.DeleteObject();
}
In the above code, even though I am calling Invalidate inside OnPaint(), it is not getting inside the OnDraw(). Pls suggest me some ways how to get inside OnDraw()
|
|
|
|
|
HWND Hwnd = GetSafeHwnd();
::SendMessage(Hwnd , WM_PAINT, 0,0);
?
|
|
|
|
|
How can this call OnDraw(). Pls Explain... Also Tell me where to include your code
|
|
|
|
|
If you send PAINT message in your CTestView class windows can call OnDraw(CDC* pDC).
|
|
|
|
|
Why are you mapping the OnPaint?
See the MFC code of CView
void CView::OnPaint()
{
CPaintDC dc(this);
OnPrepareDC(&dc);
OnDraw(&dc);
}
It is calling the OnDraw. So you should not map OnPaint.
|
|
|
|
|
It's risky to call Invalidate () inside an OnDraw () or OnPaint () handler because it can potentially cause an infinite loop. Call Invalidate () right after the change to your data that you want to appear on the screen.
|
|
|
|
|
Hi all,
I want to open a connection with portable device connected to my pc for this i am using COM and a interface called IPortableDeviceManager.
To get devices i am using GetDevice function from this interface but i am
not getting how to pass parameters to this function
http://msdn.microsoft.com/en-us/library/ms739556(VS.85).aspx[^]
Can anybody please help me in this...
Thanks in advance
|
|
|
|
|
I have a wstring str which has data like
This is an apple
This is a Bat
This is a Cat
And i try to write the str into file using
FILE* outfile;
fputws(str.c_str(),outfile);
When i saw the ouput file it shows:
This is a Bat
This is a Cat
Can anybody help me out?????????????
|
|
|
|
|
Can you show how are you using wstring, how is str filled?
-Saurabh
|
|
|
|
|
str = L"This is an aple";
str+=L"\n";
str+=L"This is a bat";
str+=L"\n";
str+=L"This is a cat";
str+=L"\n";
fputws((wchar_t*)str.c_str(), outFile) ;
Did u get it or i need to be more clear.
|
|
|
|
|
I just tried this using VS 2008 and it is working fine. I am not sure what is the problem, is str used at some other place.
-Saurabh
|
|
|
|
|
Your code works fine with VS6.
"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
|
|
|
|
|
Hi,
Id like to be able to intercept the output of some of the basic
windows drawing functions and record it somewhere. In particular drawtext.
Ive read that this can be achived by CBT hooking.
Despite reading several articals including the ones on this site im totally confused.
In my mind I image the process should work like this ...
I write a function call mydrawtext which takes in the same parameters as drawtext.
Writes the incomming info to a file and then calles the real drawtext.
I store it in mydrawtext.dll file and then compile it into a mydrawtext.lib
Next ...
I write a small .exe which when exectued figues out where the real drawtext function lives in memory
places a copy of mydrawtext.lib into the same address space
and then writes a few intructions to the location of the real drawtext fuction so that all calls to it are diverted to mydrawtext.
All the examples ive seen are totally confusing. Injecting insructions are inside the .dll. I cant work out whats going on ?
What would be really great is dead simple abc example of something like how to capture the input/output of the windows drawtext function.
Thanks,
Mark.
|
|
|
|
|
Hi Experts,
How can I create a entry for spacific file on right click in context menu of windows. Like if we create entry for all files, we create entry under
"*\\shellex\\ContextMenuHandlers\\OurKey" but what to do only for .txt file or .pst file?
|
|
|
|
|
|
i have a simple dialog project with a button and multiline edit control.
button click runs a worker thread which updates edit control data.
and i have also mapped the ON_WM_CTLCOLOR() to change colors of controls
and dialog.
if i run the thread 2-3 times my program crashes.but if i comment all
my coloring code from ON_WM_CTLCOLOR() it runs fine without any problem..
|
|
|
|
|
You should not update UI from workerthread.
Regards,
Sandip.
|
|
|
|