|
hi..
for loop in above code consider < as HTML TAG
so replace that with:
for(int i=0;i<rect.Width();i++)
---Sumit Kapoor---
|
|
|
|
|
|
Hi!
How can I create Controls in a CView Class ???
Please Help
MFG
RedDragon
Unix and C are the ultimate computer viruses.
Visit me: www.programming.info.ms
|
|
|
|
|
|
you can add any controls to CView with style WS_CHILD and the CView as its parent - the control can be CDialog also if use function Create() - not DoModal().
cheers
includeh10
|
|
|
|
|
Sounds like you need a CFormView instead.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I've solved the problem already. Thx to everyone
|
|
|
|
|
Sir,
I have developed an application using Win32.
Inside main(){
..
}
I have created a server socket and waiting to accept to connect.
How should I create an exe fom the command line.
It takes WS2_32.lib AS a parameter to give an exe.
Pls guide what can be command line parameters so that it can combine with the lib file to create exe..
|
|
|
|
|
You cannot link a library to an executable at runtime. How do you expect to compile the winsock library at runtime?
Kuphryn
|
|
|
|
|
my aim is ti likn the object file and the lib file to create the exe.
How should I go about this
|
|
|
|
|
kuphryn wrote:
You cannot link a library to an executable at runtime.
Sure you can. It's called explicit linking.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Correct. Explicit linking works for DLL. How about library?
Kuphryn
|
|
|
|
|
I think you can just give a #pragma directive like:
#pragma comment (lib, "ws2_32")
in your source code (It can be a common header file, like stdafx.h, if you're using MFC!)
With this directive, you will NOT require any command line parameters, or even to include the LIB/DLL file in your project settings. The compiler will pick up the LIB file and use it while compiling.
* Don't wish it was easier, wish you were better! *
|
|
|
|
|
I have Win32 console-based service app. I want to show its console for debugging purposes on the interactive user's desktop. How can I do this? I use AllocConsole to allocate a console in runtime.
Thanks,
Krishnan
|
|
|
|
|
Does the service output anything?
Kuphryn
|
|
|
|
|
How about to use TRACE and view it in DebugView or your IDE debug pane?
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
How to remove old VSS bind from project ?
When old project loads, i says that provider is not correct,
but disconnect and unbind in Visual studio,
not helps.
How to remove that old bind ?
And how to reconnect to new VSS ?
Thanks.
|
|
|
|
|
Would deleting vssver.scc and other source safe generated files help?
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Dear Friends
How can we embed a ON_BN_CLICKED function to Multithread?Please write to me and help me ASAP. Thanking you in advance.
Regards,
Bilar
|
|
|
|
|
Hi..this is just idea..
Track event ON_BN_CLICKED then call a treaded function that do all work in thread... otherwise I think it is difficult to get ON_BN_CL... in Thread..
this time I just have this Idea..I'll let u know if any other..Bye
---Sumit Kapoor--- sumit_kapoor1980@hotmail.com
|
|
|
|
|
Dear Sumit,
Thanks for the information but please let me know whether it will work in case of User-Interface Thread.
Thanks in advance........
Billar
|
|
|
|
|
HI Dear...
I'm also in doubt that whether thread work on User Interface or not..that's why I suggest u way that do not use that way...
I means.. let it do work as user interface do.. just call thread..when any event happen..
only I can help u...
OK! Good Bye..
---Sumit Kapoor--- sumit_kapoor1980@hotmail.com
|
|
|
|
|
The thread must own the button in order to get the results you are after. Since the button is most likely owned by the primary thread, interacting with it in another (secondary) thread is asking for trouble.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
The interface thread must receive the message. Then pass it along to your other threads using semaphores/conditions/queues, or whatever you use for intrathread communications.
--
Booohoo!
|
|
|
|
|
Hi
Well i am drawing on my clientDc and then i am writing to MemDC.
This MemDc i am using for saving clientDc content to Image file.
<br />
<br />
Class MyView<br />
{<br />
CDC MemDC;<br />
CBitmap m_MyBitmap;<br />
};<br />
<br />
Class MyView:rawDiag()<br />
{<br />
CClientDC dc(this);<br />
<br />
---------------<br />
Drawing code goes here. With default mapping mode <br />
---------------<br />
<br />
<br />
m_MyBmp.DeleteObject ();<br />
MemDC.CreateCompatibleDC (&ClientDC);<br />
m_MyBmp.CreateCompatibleBitmap (&ClientDC, 860, 1100);<br />
CBitmap *OldBitmap = MemDC.SelectObject (&m_MyBmp);<br />
MemDC.PatBlt (0,0,860,1100,WHITENESS);<br />
<br />
if(MemDC.StretchBlt(50, 0, 860, 1100, &ClientDC, 0, 0, 860,<br />
1100, SRCCOPY) == FALSE)<br />
AfxMessageBox("Failed to draw WFR diagram"); <br />
<br />
MemDC.SelectObject (OldBitmap);<br />
ClientDC.SetMapMode(MM_LOENGLISH);<br />
}<br />
<br />
Function for saving dc to Bitmap file. This code i got from codeproject post<br />
<br />
Class MyView::SaveDCtoBMP()<br />
{<br />
CString Filename;<br />
CFileDialog dlgFile (false,"*.*",NULL, OFN_HIDEREADONLY,"BMP Files: (*.bmp)|*.bmp||");<br />
dlgFile.m_ofn.lpstrTitle = "Save As Image File";<br />
<br />
int ret = dlgFile.DoModal(); <br />
if(IDOK == ret)<br />
{<br />
Filename = dlgFile.GetFileName (); <br />
CClientDC clientDC(::AfxGetMainWnd());<br />
clientDC.SetMapMode (MM_LOENGLISH);<br />
<br />
CBitmap TmpBitmap;<br />
TmpBitmap.CreateCompatibleBitmap(&clientDC, 860, 1100);<br />
CDC& ncDC = const_cast<CDC&>(MemDC);<br />
ncDC.SelectObject(TmpBitmap);<br />
ncDC.SetMapMode (MM_LOENGLISH);<br />
<br />
CDIBSectionLite dib;<br />
HBITMAP hnd = (HBITMAP)m_WfrBmp.GetSafeHandle (); <br />
dib.SetBitmap (hnd);<br />
dib.Save(Filename); <br />
ncDC.SelectObject(m_WfrBmp); <br />
TmpBitmap.DeleteObject ();<br />
}<br />
}<br />
<br />
I get following image as bitmap file.
I want only the clientdc content but it seems that it provides screen capture
How to attach image file alongwith post?
Leave your mark wherever you go
|
|
|
|