|
hi
in the following code:
PRINTDLG pd;
AfxGetApp()->GetPrinterDeviceDefaults(&pd);
DEVMODE FAR *pDevMode=(DEVMODE FAR *)::GlobalLock(pd.hDevMode);
...
DM_PRINTQUALITY of lpDevMode->dmFields is set but dmFields&DM_YRESOLUTION is not set. why?
(lpDevMode->dmPrintQuality,lpDevMode->dmYResolution) is (-3,0)!!! why?
i can print without any problem in applications like MS_Paint. how do such applications calculate the printer resolution? they may also bring up the print preview environment with no problem.
what's the reliable way for calculating printer resolution which works with all printers?
HP LaserJet 4 examined and it's ok with this method (600x600)
HP Deskjet 3650 examine and it's not ok (-3,0)
what's the problem and how can i resolve it?
what's wrong with the method?
thanx
|
|
|
|
|
i want display a text in any active window how to do this.
please help me
Anand
|
|
|
|
|
"Active window" is too vague a term to provide a specific answer for. Is it a dialog, a control on a dialog, a view, a control on a (form) view, or something else? Please explain further.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
if i understood u well:
try following:
HWND hwnd = FindWindow(...); // or sequnce of call of FindWindowEx
// to know a valid window's tree use spyxx from the vs tools.
SetWindowText(hwnd, "SomeText"); // This code change captions.
// or to fill up an edit
SendInput(...)
|
|
|
|
|
i want to write in desktop a text or image.
how to do this in vc++.
please help me
anand
|
|
|
|
|
Are you talking about the desktop's background (i.e. wallpaper)? If so, check out SystemParametersInfo(SPI_SETDESKWALLPAPER, ...) .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi,
I have some data in file i want to display it in the format of tables (like data from the databases can be displayed in the grids) can any one give suggestion how to display it ??? Can grid control be used with the files or someother control ????????
thanks
|
|
|
|
|
nainakhawaja wrote:
Can grid control be used...
Yes.
nainakhawaja wrote:
...or someother control ????????
Yes.
You need to familarize yourself with all of the standard controls that are available (e.g., MFC, ActiveX) so that you will know what each can and cannot do.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi,
Recently I was testing an activeX component into an MFC application developed with Visual Studio .NET 2002 (MFC 7.0). Because I have some problem with it, I test other known Active X (as Microsoft Forms 2.0 Command Button and Microsoft Forms 2.0 Option Button) and i get problems too. I can move controls, some dialogs are blocked...
Have you ever used any ActiveX component in a Visual Studio .NET 2002 MFC Application? Have you ever get any problem with it?
Thanks for your attention.
|
|
|
|
|
I just created a test dialog with my VS .NET 2003. In it I placed Microsoft Forms 2.0 Command and Option Buttons. When I used the Test Dialog option to test-run the dialog, both ActiveX controls were displayed properly.
You should try using the ActiveX Control inside the ActiveX Control Test Container. If they run properly, then the problem is in Visual Studio .NET 2002. Perhaps a bug ?
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Yes, all controls I have tested are showed properly. But i have problem when trying to move, for example. Add a commandbutton and try to use SetWindowsPos to move the button. Other error i have is that when I use option button activeX, the application launch an exception.
|
|
|
|
|
I must be being really stupid here; but I can't see any way to remove the sunken border which appears by default around a dropdown combo box. Is there any way to remove it?
Joel Holdsworth
|
|
|
|
|
i cant see too.
in my childhood i've use foolowing sollution:
if u want to use flat-control interface anywhere change combobox onto edit-button-listbox group with flat property true. the only problem is to syncronize'em
|
|
|
|
|
Derive your own CComboBox class and implement OnNcPaint handler. If you do nothing in that handler, no border will be appear. That is your starting point to draw your own border.
Jaime
|
|
|
|
|
Did anyone work with MSTSCAX ActiveX Ctrl?
Regards.
|
|
|
|
|
Yes, I have worked with MSTSCAX and it's interfaces.
Now, what is your question/problem ?
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
i use IMsTscAx control to connect to the TS Server.
setting valid server name and so on i finnaly call connect method. he return s_ok. but exploring other property's values i find that startconnected property is false - thats mean that control is not trying to connect. as a sequel connected property is false too.
what do i do wrong?
|
|
|
|
|
Unfortunately I cannot give my e-mail address, and I don't use ICQ.
First, go and download and install the latest version of the Microsoft RDP Client ActiveX Control. You can find it here[^]. After the control is installed, browse to the directory where you installed it. You can find a 'default.htm' test page there. Open it up on your browser, and you'll get a test page. Use this test page to connect to the TS client like you normally would. If the connection fails, the problem resides in the TS Server, and not in your end.
After installing, if you have Windows XP, you'll have two RDP Client controls. The one we just installed is called 'Microsoft RDP Client (redist)'. Use OLE/COM Viewer tool to browse through it's type library.
When/If the connection was succesfull, the control is tested and you can use the it anywhere you need. I have created a small example application that connects to a server IP you provide it with, and displays the login screen. The code is commented heavily, and the interesting parts are in the Connect and Disconnect buttons click handlers. Works smoothly for me. The example application is not very usable, as the display area is very small. But it'll show you how it's done. Note that in order to disconnect my application from the TS Server, you must first click outside the RDP Desktop screen, then click on Disconnect button.
You can download the source code and the example application from http://www.tpu.fi/~t1akeski/TSClient.zip. It is written with VC++ .Net 2003.
As for the problem you described, then an answer is written to MSDN:
The control connects asynchronously, so a return from a Connect call indicates only that the connection has been initiated successfully, not that it has been completed. You should respond to events on the IMsTscAxEvents interface to determine when the control has successfully connected (or has been disconnected).
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Antti, THX A LOT!!! at last, i c a light at the end of tunnel
if u need some help with vc++, ask me!
if it'll be in my competence - wait for nice reply.
best regards.
|
|
|
|
|
do u've any idea on the next:
i dont need to interract with desktop, dont wnat to c any passworddialogs and so on. i just need to make a connection, do smth (run program), and ten disconnect.
any ideas?
|
|
|
|
|
This is not possible in VC++, because the IMsTscNonScriptable interface that is required to set the password for automatic logon is not exposed by the Microsoft RDP Client Control. This is a design issue by Microsoft, they made it this way.
It is possible in VB .Net, because it doesn't care whether an interface is exposed or not. However, using it also requires some specific settings in-place for the Terminal Server. For more information, read the Knowledge Base -article Q281417 here[^].
Unfortunately I cannot help you any forwards. The easiest way to directly execute a program in a Terminal Services environment is to use the Remote Desktop Connection program and it's templates, which support automatically logging on and executing an application when the TS connection is opened.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Annti, sorri. this question is not already actual. i'd already implemented it last evening.
and its possible. IMsTscNonScriptable interface is exposing. i'd acquaint with msrdp documentation and found the way to do it.
bytheway. vc++ is more powerfull than vb, so if it posiible there then it is total-lot possible in vc++
if u r interested mail me.
-M4apai Icedis
--------------------------------
There are no impossible tasks.
There are tasks that needed infinite quantity of time.
|
|
|
|
|
Hello, Can I refer to your code about the client of MSTSCAX ActiveX Ctrl.
In vb, I can do it easily
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
AxMsRdpClient71.Server = "172.16.112.33"
AxMsRdpClient71.UserName = "gui.rs"
AxMsRdpClient71.AdvancedSettings6.ClearTextPassword = "1"
AxMsRdpClient71.Connect()
End Sub
but in vc, I cant create a member for activex mstscax.
|
|
|
|
|
Hello Antti !!!
1.) The URL you provided doesn't work now. I'm also trying to make an activeX COM client for RDP connections. Can you please upload the code again & send the URL ?
2.) How can we create the instance pointer of IMsTscAx interface class?
code:-
void Connect()
{//*pInterface pointer will be used to call the methods to make rdp connection
IMsTscAx *pInterface;
CLSID clsid = __uuidof(MSTSCLib::MsTscAx);
IID iid = __uuidof(MSTSCLib::IMsTscAx);
HRESULT hrInterface=CoCreateInstance(clsid,NULL,CLSCTX_INPROC_SERVER,iid,void**)&pInterface);
/* but here pInterface becomes NULL because clsid = __uuidof(MSTSCLib::MsTscAx)is not a valid value but if I use clsid = __uuidof(MSTSCLib::MsRdpClient2) then clsid comes out to a valid value {CLSID_MicrosoftRDP Client Control (redist)} and interface pointer pInterface also gets filled n initialized, but then after setting all the rdp connection parameters, HRESULT hrConnect = pInterface->Connect() doesn't work though hrConnect gives success message. */
<pre>pInterface->PutDomain("spider.net");
pInterface->PutServer("192.168.10.195");
HRESULT hrConnect = pInterface->Connect();
}
Is there any other way(besides done in my code) to fill this interface pointer *pInterface ?? Please help.
Regards,
Lokesh
|
|
|
|
|
Hi Lokesh,
It's been a while since I dealt with this issue. But the URL works just fine. I just tested it. Might've been a hiccup at the Microsoft end, or perhaps you cannot access it for some other reason? But rest assured, the website is there.
I can't upload the code. I would be violating Microsoft's ToS. Please visit the web-site in the link.
As for your second question, you can't. The IMsTscAx is an interface exposed by the Remote Desktop ActiveX Control. What you need to do is instantiate the RDAC itself, and query it for the IMsTscAx interface. I can't remember the RDAC's CLSID value out of the top of my head, so you'll need to use the OLE/COM Object Browser tool in order to determine it. It might be the CLSID_MsRdpClient2 you discovered) Once you have the CLSID, call CoCreateInstance with it and query for the target interface. If this fails, ask the object for IUnknown first and use the returned pointer to query for the IMsTscAx. All COM objects support IUnknown, so if you have the CLSID correct, you should be able to get it at least. If the IMsTscAx interface query returns a failure through IUnknown::QueryInterface, at least you'll have more details on why and how it fails.
As for the reasons why the 'Connect' call refuses to work, I can't say. There are numerous reasons why a Remote Desktop connection may fail, and not all of them are related directly to code. Perhaps the service is disabled? Perhaps access is prohibited? You should first try to connect to the Remote Desktop service by manually using the RDS software (Found in Start -> Programs -> Accessories -> Remote Desktop Connection). If you can connect manually to the host computer, then try the code-wise approach.
Regards,
Antti
------------------------------
Programming Windows is like
a box of assorted chocolates.
You never know what you're
going to get.
|
|
|
|