|
I'm a beginner and I already know how to use dc.MoveTo() and dc.LineTo(), but how can I draw a fine dotted line instead of solid?
Using a pen doesn't help here, it doesn't provide a fine pattern. Do I need to create a brush and how would I do this?
The line should look like this (vertical, 3 pixel width, X = black pixel):
x x
x
x x
x
x x
thanks for help and sorry for asking again!
|
|
|
|
|
I honestly don't know if this is possible using predefined DC functions but I'm not aware of such a function. You could experiment with creating a brush using the HS_DIAGCROSS style but I don't think it will be as fine grained as you wish. You might end up creating your own bitmap and blit it onto the DC (using BitBlt, StretchBlt or other methods) although I don't know what that will look like if the lines are neither horizontal nor vertical.
Your best bet would probably be to create a pen based on a LOGBRUSH since you can define a LOGBRUSH as using a bitmap as a pattern. Check out CPen::CreatePen, the LOGBRUSH struct and specially the BS_PATTERN Logbrush style.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
dabs wrote:
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
okie, I'll try. thx!
|
|
|
|
|
I think you are going to have to use
LineDDA[^].
|
|
|
|
|
can anyone give me a small example of sharing a socket across the two different processes where one process receives data and the other process sends the data .
|
|
|
|
|
The two processes would not 'share' a socket. One process would act as the server end, and the other would act as the client end. Look up "Windows Sockets" in the MSDN.
Software Zen: delete this;
|
|
|
|
|
Hi!
How it is possible remember position bands on Rebar and further to insert bang into the necessary position with necessary displacement?
|
|
|
|
|
in my PocketPC2002 app, I create a CAysncSocket object to
send a file to the server. The PocketPC uses diap-up
connection to the Internet. I got some problems:
Case 1> I don't specify the operating mode of the socket.
while the sending is is progress, if the dial-up
connection is disconnected, the mySock.Send() does NOT
return! so my program hangs! Seems like CAsyncSocket
operates in blocking mode, but the documentation says
the default mode is non-blocking!
Case 2> I specify the operating mode like following:
unsigned long mode = 1;
ioctlsocket(mySock.m_hSocket, FIONBIO, &mode);
// explicitely set it to non-blocking mode
then, after a few KBs of data are sent, i get two
WSAEWOULDBLOCK errors and then mySock.Send() always
returns 0. The whole file can NOT be sent. While in the
first case, the whole file can be sent successfully
if the network is available throughout the transfer.
I'm very confused and frustrated as well! Please HELP!
Thanks a million!
Wenrich
|
|
|
|
|
Wenrich wrote:
Case 1> I don't specify the operating mode of the socket.
while the sending is is progress, if the dial-up
connection is disconnected, the mySock.Send() does NOT
return! so my program hangs! Seems like CAsyncSocket
operates in blocking mode, but the documentation says
the default mode is non-blocking!
I can not reproduce this behaviour.
An asynchronous Send() doesn't usualy block, it rather gives the data to your TCP/IP stack. Which will then send when it "feels good" for sending (NAGLE algorithm etc). But CAsnycSocket has a problem when connecting sockets, if you use hostnames instead of IPs, the DNS could (or will) block a short time.
M
|
|
|
|
|
If an user starts a drag operation from my appl. to another application (explorer, desktop,...),
how does my appl. knows the target destination ?
For example, from within WinZip, you can drag files to explorer or on the desktop or anywhere else.
But how does WinZip knows the target destination ?
The files have to be unzipped, so WinZip needs to know the destination path?
Thx
|
|
|
|
|
IDataObject and IDropSource are the key ingredients here. You'll need to implement these if you want your application to support drag'n'drop into other applications. Also check out the Win32 ::DoDragDrop( ) API.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
I've created a dialog based application. The application's exe name is mydialog . Now I want to start it using command line parameters. Can any one tell me how ??
|
|
|
|
|
Sorry, but is this your first program ?
1. open DOS Box.
2. Type mydialog
If you have parameters f.ex:
mydialog /Parameter1
|
|
|
|
|
Pit M. wrote:
Sorry, but is this your first program ?
No dear, you didn't get my question properly. I know ho to give comand line parameters, but what i want to ask that how can we retrieve in our MFC application
|
|
|
|
|
Hi,
use GetCommandLine() WIN32 API.
Dudi
|
|
|
|
|
I created a CTabCtrl control and I succeeded in this, but the problem is that when I place any control over the tab, it is not considered as part of tab, it still react separately as not part of the tab control. My question is am I missing something or a certain tab style that makes that tab a container for any controls placed over it.
|
|
|
|
|
A CTabCtrl is a standalone control, not a container. Think of it as a fancy radio button. Your code needs to respond to tab selection and display appropriate controls at the right time. I group my controls ("tabs") in modeless dialogs, which I show/hide in response to the user's selection.
See this thread for details.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hello,
INTRODUCTION:
I'm trying to get autosizing property sheets, and what I do is to place a CStatic in the dialog in which I want the property sheet inserted.
I resize the CStatic when I resize the dialog and I send the WM_SIZE message to the Property sheet too.
In the property sheet WM_SIZE handler I get it's parent rectangle and call a SetWindowPos in order to resize the property sheet.
QUESTION:
Why the size of the rectangle of the Cstatic don't change? I Get always the same size.
As always thank you in advance...
CODE USED:
in the WM_SIZE handler of the property sheet.
<br />
CRect rectClientPare;<br />
this->GetParent()->GetClientRect(&rectClientPare);<br />
this->SetWindowPos(NULL,2,0,rectClientPare.Width(),rectClientPare.Height(),SWP_NOZORDER | SWP_NOACTIVATE);<br />
|
|
|
|
|
To resize the static control you should either call MoveWindow or SetWindowPos - you should not send it a WM_SIZE message.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
I get lots of warnings when working with STL in debug. In fact I always get the same:
warning C4786: ... identifier was truncated to '255' characters in the debug information
I thought that including a pragma like
#pragma warning(disable: 4786)
would the twist. But I still get the warnings. Anybody has a (miracle) solution?
Jonathan de Halleux, Belgium.
|
|
|
|
|
Put the #pragma before including any STL header.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
Where do you have to insert it ?
Jonathan de Halleux, Belgium.
|
|
|
|
|
check this[^] out.
It is freeware with source-code (pearl script) and works like a charm.
For switching off warnings via a #pragma , please read MSKnowledgebase entry Q167355.
- It simply does not work.
|
|
|
|
|
Thanks for the tip ! It's great !
Jonathan de Halleux, Belgium.
|
|
|
|