|
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.
|
|
|
|
|
I need a windows control that has multiple radio buttons in a row, to allow the user to select and deselect a number of options specific to a single item.
Does this exist, or is the only way to roll my own?
If I have to roll my own is the a good article to look at?
Thanks
|
|
|
|
|
Are you talking about having a row of radio buttons, from which the user can select one ?
Then the answer is control grouping. Take any dialog template. Then place the row of radio buttons there. Now, go to the Tab Order option, and make sure that the radio buttons are set into an ascending order so that the first radio button has and index, say, 6, the next is 7 and so on, until the end of the row. Then go to the properties of the first radio button, and check the option 'Group'. All other buttons must NOT have the Group option set.
The Group option works so that the first control in the tab order that has the Group option set becomes the first member of the group. All adjacent controls (in the tab order) of similar type belong to the same group until a) another similar control with the group option set is met or b) a different type of control is met.
To access this group code-wise, add a member variable to the first radio button control, and take it's value. The value returned is a zero-based index on the radio button that is selected. Like, it's 0 if the first one is selected, 1 if the second and so on..
For a good example, go here[^].
Remember that the radio buttons can be vertically, horizontally or diagonally placed on the dialog. The tab order determines how they are grouped, not their physical position.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Yes, kind of, the only trouble is that its purpose is to allow the user to select/deselect 0 or more types that a particular row on a database table is applicable for. This means that at runtime every row returned from the database needs to have one of these multi-row radio buttons next to it. I was going to use a Listview control in report view with one of these multi-row radio buttons attached to each item. And then in the OnOK handler for the dialog I would set up the database links according to the types selected for each row.
|
|
|
|
|
Stone Free wrote:
...its purpose is to allow the user to select/deselect 0 or more types that a particular row on a database table is applicable for.
If the items are mutually exclusive, use checkboxes instead.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
The items arent mutually exclusive, hence 0 or more types. Zero types could be set or 3 of them or all of them. It needs to be a unified control so that I can have one of them for each row in the Listview that have been returned from the database.
|
|
|
|
|
Stone Free wrote:
The items arent mutually exclusive, hence 0 or more types.
Exactly my point. With radio buttons, one and only one in a group is selected. With checkboxes, all, some, or none of them can be selected. If you are allowing 0, 3, or all types to be set, then a checkbox is your only option.
In your original post, you likened it to a "voting control." When you are voting for a group of related items (e.g., size of pizza, score of an article), you only get to select one of them. If the items are mutually exclusive (e.g., toppings on a pizza, favorite programming language), then you can select any number of them.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Sorry when I referring to "Voting Control" I was talking about the look of the CodeProject article voting control, rather than its function.
OK, if we change this to a row of checkboxes where 0 or more items can be selected. I still need it in the form of a single control that would be able to return its state and live in each of the rows in the Listview control
|
|
|
|
|
Stone Free wrote:
OK, if we change this to a row of checkboxes where 0 or more items can be selected.
No problem. I've used this control for exactly that purpose. For each row was the name of a scheduled job in column 1, and in the other dozen or so columns were the different permissions (e.g., read, write, execute, delete, manage) for that particular job. Worked great.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi,
I am having some problem with property sheet.
A property page contains static text and one command button (namely "Click")
When we press the Click button on a property page then static
text should be Changed or hide.
What should we write code?
rajesh
|
|
|
|
|
try,
((CWnd*)GetDlgItem(YOUR_STATIC_ID))->SetWindowText("the text");
good luck.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|