|
ok,
sorry I could not help you on the DrawString function. I use it in many of my projects, and I never had any problem with it.
I'm happy I could help you to support large/small fonts on your projects. Normally, aware developpers should support it. it's in the white papers of GUI's Windows.
Best regards.
Bouli.
|
|
|
|
|
How do you craete the font that you use to display the text? Post that code here, most likely cause.
Normally you create a device independent font of the same size like this:
int fontSize = -MulDiv(10, pDC->GetDeviceCaps(LOGPIXELSY), 72);
This create a font on a DC with a size of 10. Regards of the DC's DPI
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
hi im Aswin,
i have to create a service which when started acts as a server listening at a particular port. when a client sends a message the server starts process like notepad mspaint etc.
plz explain me the step by step process involved in creating the windows nt services. i know how to create the socket program for server and client .
i need to know how to integrate the socket program with windows nt services.
i have the idea about csocket.
regards
Aswin.N.Paranji
|
|
|
|
|
Check out these articles:Both Pablo and PJN write excellent articles and code.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
hi im Aswin,
i have to create a service which when started acts as a server listening at a particular port. when a client sends a message the server starts process like notepad mspaint etc.
plz explain me the step by step process involved in creating the windows nt services. i know how to create the socket program for server and client .
i need to know how to integrate the socket program with windows nt services.
i have the idea about
|
|
|
|
|
Hi!
I'm trying to use some functions in a dll written in VB 6.0. I have sample code for using the dll from VB (se below) but I don't really know how to go about using it from my C++ app. Any help would be very much appreciated!
VB code exemple:
<code>
'Declaration:
Private MyVBObject As New TheVBObject.cTheVBObject
'Startup:
If Not MyVBObject.Init("Arg1","Arg2","Arg3") Then
MsgBox "Init Fail!", vbCritical & vbOKOnly, "Init"
End
End If
'Use:
MyVBObject.Var1 = " "
If MyVBObject.DoStuff("Arg1","Arg2") Then
If MyVBObject.Error > 3 _
And (MyVBObject.Error <> 4) Then
MsgBox MyVBObject.ErrTxt frmObject.MousePointer = vbNormal
Exit Sub
End If
Else
MsgBox "Error using it", vbCritical & vbOKOnly, "Using"
End If
'Read the properties...
'Dim MyProp = MyVBObject.Prop1
'... or something like that...
</code>
|
|
|
|
|
Check out MSDN Article #ID Q194873 example 2 for an easy way. Or look at http://www.codeproject.com/com/vb_from_vc.asp for some other helpful hints. It requires you to understand COM under C++ but the CP link is a beginners article that is easy to understand.
|
|
|
|
|
Thanks for the answer. The codeproject article was really great!
/Killen
|
|
|
|
|
hi,
I am trying to insert an image in HTML page at the place where currently cursor is,
when the user clicks my toolbar button.
It does insert it but after inserting the image, the cursor
is not coming up.
I need to have the cusror come up next to the image. So that I can
type some text.
this is the piece of code i am using:
CComPtr<ihtmldocument2> spDoc;
/////
////some more code for getting spDoc
//////
//Here is the code for inserting image
CComBSTR cmd = _T("InsertImage");
spDoc->execCommand(cmd, FALSE,CComVariant(myImage) ,0);
CComPtr<ihtmlselectionobject> selectObj;
spDoc->get_selection(&selectObj);
if (selectObj)
{
selectObj->empty();
CComPtr<idispatch> iDispRange;
selectObj->createRange(&iDispRange);
CComQIPtr<ihtmltxtrange> range(iDispRange);
if (range)
{
range->select();
range->collapse(false);
}
}
///////////////////////////////////////
What happens is cursor always comes at the start of the document.
Can anyone tell me how can I get that done ?
Regards
Raj
|
|
|
|
|
Hi!
I have a Drop list style CComboBox with the ID: IDC_TOLT
I want to populate this combobox in the OnInitDialog() of the dialog:
CComboBox* pEdit = (CComboBox*)GetDlgItem(IDC_TOLT);
pEdit->AddString("asd");
The problem is that the "asd" doesn't appairs in the combobox
Thanks for your answer!
Thanks for your answer!
|
|
|
|
|
What size did you give to the dropdown menu when creating the control in the resource editor ?
try
CComboBox* pEdit = (CComboBox*)GetDlgItem(IDC_TOLT);
pEdit->AddString("asd");
pEdit->SelectString(-1,"asd");
If you still do not see the "asd", then go in the resource editor, position your mouse cursor on your control (on the block with the arrow on the right), your cursor will change to a double vertical arrow, then click and hold the button down and increase the size of the dropdown menu of your combobox.
~RaGE();
|
|
|
|
|
This is a common mistake every one makes when working with combo box for the first time, i dont know from where did the microsoft got the idea for sizing the combobox.
The World is getting smaller and so are the people.
|
|
|
|
|
I was trying to develop a application to be able to show different documents
like .doc, .ppt etc in its view. So I decided to use the Browser Control for
the same and I was able to successfully load (navigate) the different
documents. My next requirement is to draw some custom text and graphic on
top of the loaded document window but I was not able to hook any message to
do the same. It seems that once the document is loaded, it is that
application which does all the message handling like paint etc. Is there any
way out for solving this problem. Thanks in advance for any help on this.
|
|
|
|
|
If your using an IE window try looking at the DOM. There are many articles on the web using DOM from a C/C++ program
|
|
|
|
|
Hi, I want to add an icon left of the menutext in my menues.
For example I have an icon in my toolbox and an equal text entry in my menu. So it would be nice if there is text and additionaly the icon of my toolbox in the menu.
Unfortunately I have no idea how to place an icon in a menu.
If anybody can help me, write an answer please.
SuperRon
|
|
|
|
|
change the menu items style to owner draw style,then draw it yourself.
Check out the BCMenu code for detail.
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
Ok, but how can I change the menu items style? And how can I connect the icon with the menu item then?
Where do can I find the BCMenu code?
Please, help me again
|
|
|
|
|
Get the menu handle or CMenu object(before the menu popup),use ModifyMenu to assign every menu item MF_OWNERDRAW style.
And then your windows will be receive WM_MEASUREITEM and WM_DRAWITEM message,in the message handler
you measure your menu item size and draw it as your wish. If you use MFC,it would be more easy. MFC
will call your CMenu::MeasureItem and CMenu::DrawItem() automatically.
BTW:
you can find BCMenu in CP.
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
Thanks, I found BCMenu, and it works pretty nice.
|
|
|
|
|
Hi,
I have created a Named Pipe with a NULL DACL security descriptor to allow everyone to access the pipe on a server application and have also created a client application to connect to it. All works fine if client and server are on the same machine but i get a
0x0000052e Logon failure: unknown user name or bad password.
When using a remote client.
Anybody shed some light on this will be appreciated.
Ceri
|
|
|
|
|
If you specify NULL as DACL, the named pipe gets a default security descriptor. The ACLs in the default security descriptor for a named pipe grant full control to the LocalSystem account, administrators, and the creator owner. They also grant read access to members of the Everyone group and the anonymous account.
So check if u can communicate with client machine with administartor rights.
Else set named pipe's security descriptor by calling the SetSecurityInfo function.
Chill,
The chosen One
|
|
|
|
|
No, that is incorrect. That's true if you specify NULL for the lpSecurityAttributes to CreateNamedPipe. I am creating a security attribute structure but the DACL for the security descriptor is NULL - see below
<br />
<br />
<br />
SECURITY_ATTRIBUTES saPipeSecurity;<br />
PSECURITY_DESCRIPTOR pPipeSD = NULL;<br />
<br />
memset ( ( VOID *) &saPipeSecurity, 0, sizeof ( SECURITY_ATTRIBUTES) );<br />
<br />
if ( ! ( pPipeSD = ( PSECURITY_DESCRIPTOR) <br />
( malloc ( SECURITY_DESCRIPTOR_MIN_LENGTH)) ) )<br />
return FALSE;<br />
<br />
if ( ! InitializeSecurityDescriptor ( pPipeSD, <br />
SECURITY_DESCRIPTOR_REVISION) )<br />
return FALSE;<br />
<br />
if ( ! SetSecurityDescriptorDacl ( pPipeSD, TRUE, ( PACL) NULL, FALSE) )<br />
return FALSE;<br />
<br />
saPipeSecurity.nLength = sizeof ( SECURITY_ATTRIBUTES);<br />
saPipeSecurity.bInheritHandle = TRUE; <br />
saPipeSecurity.lpSecurityDescriptor = pPipeSD;<br />
<br />
<br />
HANDLE hPipe = CreateNamedPipe("\\\\.\\pipe\\PipeTest",PIPE_ACCESS_INBOUND ,PIPE_TYPE_BYTE,PIPE_UNLIMITED_INSTANCES,4086,4086,20000,&saPipeSecurity);<br />
<br />
|
|
|
|
|
Hi CPians,
I'd like to write a small dialog app doing a kind of Search in File just like the one in Visual C++. Does anybody know how this works ? The search is really fast, so I think there must be another solution than loading the file as text in a CString and applying the Find method
Thanks for the advices
~RaGE();
|
|
|
|
|
One solution is file-mapping.
Kuphryn
|
|
|
|
|
hello
can some body tell me about TAPI 3 COM based working in Visual C++. i am doing "internet telephony" project. where i need that codec for interactive voice support using Visual C++ 6 and TAPI 3.
thanks
|
|
|
|