|
i found the solution:
http://www.gotdotnet.com/Community/MessageBoard/Thread.aspx?id=119342&Page=1#119937
|
|
|
|
|
Hello,
I'm currently looking in to making a modified dropdown control, and as with the standard dropdown in .NET API I want to be able to let it extend outside
the bounds of the window containing it if necessary. So how do I go about to do this? I really don't know where to start (or, I would give WIN32 API as an educated guess, but...)
does anyone have any information/hints/references to help me?
/Bjorn
|
|
|
|
|
I am new in C#, can someone please tell me what's the best solution writing a console application for this scenario:
A manufacture sells the following vehicles: trucks and motocycles. They want to be able to track the vehicles by model, color, and price. In additioni to the above shared information, they also need to track engine type for trucks. Also, they need to track tire size for motorcycles. Finally, they want a function to display the data for their vehicles.
Thanks in advance.
CT
|
|
|
|
|
|
is it possible to manipulate an obj inside an arraylist with a reference to it that is outside the list. more clearly - i create an obj and then add it to arraylist. but i still have a reference to the obj. can i use this ref to manipulate the obj values even if it is in an arrayList.
"Excellence is never an accident" - JJC
|
|
|
|
|
If the object is a class then yes you can.
if its a struct then you can't as it will be copied.
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
Hi all
I have a problem with visual studio .net. I insert a breakpoint, but it says "The breakpoint will not currently be hit. No symbols have been loaded for this document". What can i do fix this?
Note: I am running the project in debug mode, not release mode.
|
|
|
|
|
This happens to me quite a bit....
1st, make sure in your project properties that the setting to Generate Debug Info is set to true. If it isnt, simply set it to be so an recompile.
If it is already true, set it to false, recompile, back to true, recompile. 9/10 that will get my breakpoints working again.
Good Luck!
|
|
|
|
|
Morning guys and girls,
I'm trying to get a list of methods from a COM object that I only know the ProgID of.
This is the code I thought would work...
---
Type t = Type.GetTypeFromProgID("xxx.yyy");
if (t != null)
{
MemberInfo[] members = t.GetMembers();
for (int i = 0; i < members.Length; i++)
MessageBox.Show(members[i].Name);
}
---
But this only seems to return methods that exist in c#'s object object (if you know what I mean!).
Anyone have any ideas?
Thanks in advance,
Simon.
|
|
|
|
|
I did it from C++ like this. (I am still learning C#)
1. Get the ITypeLib by using LoadTypeLibEx[^] function.
2. Get the number of type descriptions from typelib via GetTypeInfoCount[^] method.
3. Then I used GetTypeInfo[^] and GetTypeAttr [^] methods.
4. Now play with TYPEATTR[^] members which contains all the info.
Use the links provided to find the solution for C#. Let me know how it works.
"...if you don't want to hear things that piss you off don't piss off other people. SIMPLE." - Steven Hicks This signature was created by "Code Project Quoter".
|
|
|
|
|
Thanks Kant,
I am using the LoadTypeLibEx method, and then using a System.Runtime.InteropServices.TypeLibConverter to convert it to an assembly. I can then get all the objects in the DLL by using reflection (GetTypes etc).
Cheers.
|
|
|
|
|
Hmm.. Using TypeLibConverter, if you don't mind can you post the code snippet. I am just curious. Anyway I tried like this C#.
LoadTypeLibEx(strCOMLibName, REGKIND.REGKIND_DEFAULT, out oCOMTypeLib);<br />
if(oCOMTypeLib != null)<br />
{<br />
TYPELIBATTR oTypeLibAttributes = new TYPELIBATTR();<br />
Type oType = oTypeLibAttributes.GetType();<br />
..<br />
..<br />
oCOMTypeLib.GetLibAttr(out hwndTLibAttr);<br />
"...if you don't want to hear things that piss you off don't piss off other people. SIMPLE." - Steven Hicks This signature was created by "Code Project Quoter".
|
|
|
|
|
This is what I did Kant:
LoadTypeLibEx(lstrFilename, RegKind.RegKind_None, out typeLib );
if (typeLib != null)
{
AssemblyBuilder asm = converter.ConvertTypeLibToAssembly(typeLib, "tmplib.dll", 0, eventHandler, null, null, null, null );
Type[] types = asm.GetTypes();
}
Once you have this, you can loop around the types to get the methods...
for (int i = 0; i < types.Length; i++)
{
MemberInfo[] meths = types[i].GetMembers();
for (int j = 0; j < meths.Length; j++)
{
MessageBox.Show(meths[j].Name);
}
}
Hope this is useful to you. Thanks again for your help,
Simon.
|
|
|
|
|
After your post, I read the information about TypeLibConverter . I went in a different route to get the info. (I followed the same path I did in C++)
Anyway, I want to write a small article about this. Do you want to jump in?
Except for MSDN, I haven't found any useful info about reading COM information via C# anywhere.
"...if you don't want to hear things that piss you off don't piss off other people. SIMPLE." - Steven Hicks This signature was created by "Code Project Quoter".
|
|
|
|
|
Hi
I don't really think I know enough to write an article to be honest. Also, I'm not very good at explaining stuff in a concise fashion!
Feel free to ask me any questions or use any of my code in the article though (and I'll rate it a 5 for ya! ).
Cheers,
Simon.
|
|
|
|
|
I have created a UserControl that allaws a DataObject to be dragged.
The DataObject contains a Bitmap and string.
When the DataOject is dropped into MSWord. MSWord displays the text.
Does anyone know our to force MSWord to display the Bitmap.
I have tried adding the Bitmap to the DataObject first followed by the string.
But this has no effect.
|
|
|
|
|
hi, i have a real quick question. I just need to find the X,Y (0,0) for the location of my programs Window in relation to the entire Desktop. Reason being is i use a API call called GetPixel() that uses X,Y (location) as a overload...but its X,Y are global X,Y i.e the entire desktop. I need to transfer my X,Y inside my program over to Global Desktop X,Y's. is there a easy way to do this ?
Thanks for your help, Time. If you need me to explain clearer please let me know
Jesse M.
The Code Project Is Your Friend...
|
|
|
|
|
Use Form.PointToScreen().
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Thank you very much Sir.
Jesse M
The Code Project Is Your Friend...
|
|
|
|
|
I would like to know how can i combine and connect different projects into one big project?
e.g.
i have an existing project - TEST_A. I want to add this project into my new project (current working this one) - TEST_B.
I know i can add "existing project" into my current project. But i don't know how to connect both project, so that i can access the form in TEST_A.
Please help!!!
|
|
|
|
|
Create a blank solution, then you can add as many projects to that solution. To add a new solution click on File > New > Blank Solution.
|
|
|
|
|
But how can i access the items in different projecT?
|
|
|
|
|
HELLO,
here is a little problem that i am facing.
in a foreach( ) loop, i want to display a message box or anything,
but i want to display that after some gap. i.e. PRODUCING SOME DELAY
is there any method like delay() in c/c++?
i found timer class for windows forms in c#, but there is some problem
with it. it just says invalid com component exception after each
display of the message box. i just want to have a gap of 30 seconds. if there is anyother way plz guide me.
can someone guide me on this. A piece of code or link.
i would really be thankful on this help.
LOOKING FOR HELP
ASIM.
Asim
|
|
|
|
|
Thread.Sleep(1500);
will cause a 1.5 second pause before going to the next line of code..
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
Can some one point me to a good resource on WMI using c#
Thanks
|
|
|
|