|
That's the port number of the client end of the connection, not the server end.
The client end cannot listen for new connections, it can only receive data sent from your server socket, until the connection is closed.
I suggest you read the Winsock Programmer's FAQ[^].
|
|
|
|
|
Hi all,
Is there any way to get the exposed cell values of grid like DBGrid, MSFlexiGrid which is in some running applications and also to get the exposed method names?
Regards,
Naveen S G
|
|
|
|
|
Hi all,
i would like to know how to get the control names (like editbox name or combobox name) from running VB/Delphi application.
i need this to identify and work on those controls.
it is required for me to automate the testing process of that application.
Naveen S G
|
|
|
|
|
|
Hi Michael,
i want to extract the name of controls like editbox or grid control which exists in some running application.
u might be knowing there will be name associated with every control in Visual Basic. Using name only(instead of window handle) we work those controls in VB.
i would like to know how can i get that name from my vc++ program.
Thanks in advance,
Naveen S G
|
|
|
|
|
You're either wanting to know the id of the control (GetDlgCtrlID() ) or the window class name (GetClassName() ).
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi David,
i m not wanting to know the id of control. i want to extract the name of control. for e.g.: in vb name of editbox is Name. if u want to display its text u can do it using Msgbox Name.Text . this name, i want to extract. because identifying controls of another running application is easier with name than with objectIndex and Class name.
Thanks in advance,
Naveen S G
|
|
|
|
|
naveensg wrote:
i want to extract the name of control.
This is a VB thing. Controls in VC do not have names, they have ids instead. Your MsgBox Name.text statement would equate to the following in VC:
GetDlgItemText(...); or GetWindowText(...);
MessageBox(...);
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
i accept that controls in VC do not have names. but i want to extract the control name of running VB Application from my VC Program.
|
|
|
|
|
Any standard ActiveX Container (i hope VB is) should support for DISPLAYNAME ambient property that from inside of the control could be accessed through
GetAmbientProperty(DISPID_AMBIENT_DISPLAYNAME, var);
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
do u have any sample code related to that. if u have plz mail me.
i have read in some article that by getting container of the form and by doing queryinterface, v can get the name of controls.
|
|
|
|
|
It's straightfoward:
If you are using MFC and your control is COleControl derived somewhere inside of your controls code just use the following:
...
CString strControlName;<br />
GetAmbientProperty(DISPID_AMBIENT_DISPLAYNAME, VT_BSTR, &strControlName); ...
After that strControlName will be filled with the name assigned to your control by the container.
For implementation detailes see GetAmbientProperty implementation in MFC.
Regards
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
just take for example there are no activex/ole controls in VB form. it contains only standard controls like editbox, combobox.
just by getting window handle, is it possible to get the clientsite/IDisapatch/IUnknown. because if i get the clientsite, it is possible to get the control names.
Given a pointer to IOleClientSite, it is possible to enumerate through all of the other controls on a form by making use of the following interfaces:
IOleClientSite,IOleContainer,IEnumUnknown,IUnknown,IOleObject,IOleClientSite,
IOleControlSite.
but my question is:
i have only window caption and its class. by using those information is it possible to get the clientsite of the VB Form.
Thanks in advance,
Naveen S G
|
|
|
|
|
Common answer is NO.
However, you may try to look into the following possibilities:
1. If your VB App is automation server -- maybe there is method that returns you what you need -- is it registering itself in Running Objectc Table or maybe it's singleton -- you can get IDispatch of it;
2. Maybe VB Form is dynamic container and allow new control insertion -- so you may write your new control that has functionality you need;
3. If form has at least one ActiveX Control -- you can look into it's CLSID and write your control that will register under the same CLSID as original one and will be just an aggregator for original control -- so VB Form will create your control and your control will be delegating all OLE calls to original control;
4. Overload CoCreateInstance -- using different techniques of injecting your code -- try overloading CoCreateInstance/CoGetClassObject -- it is possible that control name could be extracted through VB Extender control -- passed to CoCreateInstance as pOuterUnknown;
5. If your VB App is Active Accessibility Compliant: Check AccessibleObjectFromWindow available in OLEACC.dll as well as read that article and search MSDN:
http://msdn.microsoft.com/msdnmag/issues/0400/aaccess/default.aspx
In any case it's R&D and may require alot of efforts to implement or fail -- unless VB code is accessible for modifications...
Regards
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
i would like to know how to get the handle of context menu of some other running MFC application or how to work on context menu of some other MFC application. i want to check whether some particular menu item is enabled or not.
if anybody knows, plz mail me.
Naveen
|
|
|
|
|
Your going to have to setup a hook of some type. Take alook at the article about injecting code into another process. You can find a link on the codeproject homepage under most popular articles on the right hand side.
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
Hi Allen,
thanks for replying.
i want to check whether some particular menu item exists and is enabled in the context menu of some running MFC Application from my VC/VB program.
if u have any sample code or articles related to that, plz mail me ASAP.
Thanks in advance,
Naveen S G
|
|
|
|
|
Hi! I have a button in my app that I want to have the ability to have urls (Hotlinks from in webbrowsers) dropped on it. How would I go about setting that up, and knowing that it was a hotlink that was being dropped etc.
Cheers
Dom
|
|
|
|
|
Read the Platform SDK documentation on OLE drag-and-drop. See (at minimum) the IDropTarget interface and the RegisterDragDrop function.
MFC offers a helper class: COleDropTarget and its Register method.
|
|
|
|
|
Thanks for that A bit of a newbie question here but is it possible to overide a function for an instance of a class rather than for the entire class?
Cheers
Dom
|
|
|
|
|
Improperly interfacing between the hardware and software is there will cause pc damage. How to avoid this problem occurs? Is there any tutorial will helping in interfacing.....
|
|
|
|
|
It depends entirely upon what you are interfacing too? Obviously plugging your serial port into the mains power supply is going to cause a few problems... best advice is: don't do it unless you know what it is you are doing.
|
|
|
|
|
If there any website which can provided interfacing example or basic tutorial.How i have to do if i don't have knowledge about printer port interfacing.....
|
|
|
|
|
|
Thank you for yr suggestion Jonny.........
|
|
|
|