|
I want to write an application, that monitors a third party application, by examining the properties and values of those properties associated with that application's controls. For example, if the control is a button, I'd like to get a list of all it's properties and their values (e.g. if the button is enabled or disabled). If the application has a grid or spreadsheet component, I'd like to get the number of columns, rows, the column headers, and the values in the individual cells. I know how to get a window/control's text with GetWindowText, however; I need much more info than that.
Can this be done? The internet searches I have done to date, (and I have searched other forums) have come up short. Can anyone give me advice/pointers or point me to resources to help me?
Thanks!Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
The only suggestion I can offer is to check the type of control when you get a handle to it, and then use the other Win32 calls to check the different styles and states it is using. This will mean checking all the options for every type of control; a fairly tedious task. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
This isn't really an answer for you, but on that other OS, system support for this kind of thing is in "Universal Access", which is a suite of tools for supporting people with disabilities. Are there similar facilities in Windows?
|
|
|
|
|
Ron Aldrich wrote: Are there similar facilities in Windows?
Not that I'm aware of. You could try searching Google to see if anyone else has come up with a solution.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
I have a class in C++ (unmanaged) which I would like to place a wrapper around in managed (visual) C++ in order to create a dll which I can use in C# applications as a class library.
I'm having quite a bit of trouble getting this to work by following MSDN's article here:
http://msdn.microsoft.com/en-us/library/aa712961%28VS.71%29.aspx[^]
and was wondering if this is even possible in VS2008? If there's a tutorial showing how to do this I'd be greatly interested in seeing it.
Thanks for any help / advice
Gvanto
|
|
|
|
|
I've done this several times. If you have a specific question, I'd be glad to do what I can to help.
|
|
|
|
|
Hi Richard,
I'm just after an example of how to do it.
Came across this: Managing the Unmanaged Code[^]
In VS2008, what project do I need to create to get started in this?
Cheers
gvanto
|
|
|
|
|
You create a new C++ project (MFC allowable) and then once it's created, go into the project properties and enable CLR support.
Now your C++ project can mix managed and unmanaged code.
|
|
|
|
|
thanks Richard with some fiddling got it working!
pretty stoked, the possibilities are now endless
|
|
|
|
|
Hi,Im using WPF as C# dll in VC++.Im sending datas to the Listbox inthe third tabitem in a tabcontrol by using this coding.
void CToolTab::SendPresetmenu(CString menu)
{
FrameworkElement^ page;
String ^ msg = gcnew String( menu );
Globals1::gwpreset->AddPresetmenu(msg);
page = Globals1::gwpreset;
Globals1::gHwndSource->RootVisual = page;
}
By this code,wat happend is my entire tabcontrol becomes a third tab item.there is not other tabs .
If i commented those last two bolded line.Full tabcotrol appears correctly but the listbox doesnot contain text.
How can i do that?Anu
|
|
|
|
|
I created a c++ .net dll, in which I need to implement logging. I decided to go with Microsoft Enterprise Library's Logging.
Now, I am calling this dll from a COM application (I created a .tlb from the dll to use in the COM application), and the error I am getting is this:
Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
How can I get around this??
TIA
|
|
|
|
|
chana gibber wrote: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
That is pretty straightforward. Is that file exist?Best wishes,
Navaneeth
|
|
|
|
|
yes, the file exists in the debug folder of my (c++) dll.
It did not get carried over to the debug folder of the COM exe.
What do I need to do with Microsoft's dll in order to get it running in my exe?
|
|
|
|
|
Have you tried copying it manually to the COM exe's folder? If it didn't worked, use dependency walker and profile the EXE to identify which dependency is actually failing. Best wishes,
Navaneeth
|
|
|
|
|
yes, I tried copying it. But remember, this is a COM exe. Does that require a tlb file instead of a dll file?
|
|
|
|
|
I got it working. I created a tlb file for each of Microsoft's dlls using regasm/tlb
|
|
|
|
|
Wow I am burning my brain right here... I'm so very close to just saying screw it and writing some sort of conversion myself.
First I'd love to know if there is an existing macro to do what I want to do...
I have a char array:
char OutputBuffer[1024] = {0}; (huge i know, but ill lower the size later )
that has a byte put into it... (78 AB 45 44) is a value I had at one time... as a float it means 790.67919921875
note!: this value has been read straight from memory
The problem is I cant get this DWORD into a float for the life of me...
Is there any existing macro? If not throw me a bone and tell me how i might convert this into a float from scratch...
|
|
|
|
|
Mattzimmerer wrote: The problem is I cant get this DWORD into a float for the life of me...
If this is already a float (as you state) then there is nothing to do. If you mean reference it as a float then you just use the (float) cast in front of the reference.
Or do I misunderstand your problem?MVP 2010 - are they mad?
|
|
|
|
|
I don't know about an existing macro, but this will do it:
char OutputBuffer[4] = { 0x78, 0xAB, 0x45, 0x44 };
float d = *((float*)&OutputBuffer[0]);
|
|
|
|
|
This worked great, thanks!
Now i have a new trick lool, why didnt i think of that: cast it as a pointer of the type i know it is and then deference it =D...
|
|
|
|
|
Assuming your code is managed and you're in the right forum, have a look at BitConverter.ToSingle()
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
One caveat to the BitConverter class is the endianness it uses is based on the architecture of the machine the program is running on. So if you're interfacing to a piece of hardware and its endianness doesn't match the endian-ness of the computer, or you're reading a binary file created on a computer with a different endianness and using BitConverter, then BitConverter will not give the correct result.
DybsThe shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen
|
|
|
|
|
Sure, whatever method is used, one better is aware of all applying conventions; endianness being the most relevant one here.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
The CLSCompliant attribute does not work in C++/CLI. You can see my report on this some time ago at https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=431084&wa=wsignin1.0[^] and Microsoft's refusal to fix this.
Is there any other way to check for CLS compliance in C++/CLI code ?
I have tried to use FxCop but there is no subset of FxCop rules which I have ever found which checks only for CLS compliance. I have no interest in trying to either spend days figuring out which subset of FxCop rules is CLS compliant or of trying to change my code to satisfy all of FxCop, many of whose rules I find way too finicky for my own .Net programming practice.
Hopefully there is some way to check for CLS compliance in C++/CLI now that Microsoft refuses to support this for C++/CLI programmers.Edward Diener
|
|
|
|
|
Edward Diener wrote: Hopefully there is some way to check for CLS compliance in C++/CLI now that Microsoft refuses to support this for C++/CLI programmers.
I am not sure about alternative methods to enforce this. And AFAIK, MS is not supporting C++/CLI much.
Following is my explanation about why compiler can't enforce this,
As Jonathan Caves said, C++'s compilation model is making this difficult to implement. Each source file will be compiled into object files independently and it is hard for the compiler to check for the attribute defined in another translation unit. If you apply this attribute for the assembly, then it will be in AssemblyInfo.obj file. Compiler cares only about the current translation unit and don't know anything about other translation units. This makes it hard to find the attribute usage which is on another translation unit.
Best wishes,
Navaneeth
|
|
|
|