|
Thanks for your reply.
I have already installed it on my computer but keeps on hanging up...
Any other suggestion?
Edgar Berengena Moreno
Software Engineer
Appeyron Research
|
|
|
|
|
|
I had problems with SmartHelp and IDE, dunno if this is related.
Format is allways a solution
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
this is a known problem with vs 7.0, it is not fixed in sp1 pr sp2, there are steps to help the problem but to be honest i can't remember what they are (sorry).
if you post your problems to the microsoft.public.dotnet.languages.csharp newsgroup you will get a lot of help there.
I get it about 4 times out of 10, but I get usually get it to work by clicking the restart toolbar button.
I vaguely remember it also helps if you don't use your system to host a web dev stuff (asp), stopping some of the services on your machine to do with this helps, although it never fixed mine as I don't use the machine for asp stuff.
There is also some stuff on msdn/technet aboput the problem as well.
sorry I couldn't be of much help.
bg
|
|
|
|
|
Our group has encountered the same problem. We have found two things that will "un-hang" the IDE.
1. Disconnect your network connection (I have created a short-cut to enable/disable the connection).
2. Run the NET configuration utility (don't know why this works but it does).
|
|
|
|
|
EdgarBM wrote:
after
uninstalling the beta version of Visual Studio .NET.
Before you installed VS.NET did you make sure to remove all traces of the beta?
Chances are mscoree.dll was still lying around somewhere on your hard drive and that could have screwed some stuff up.
FWIW, when you got the Beta package there were several warnings about not being installed on a primary computer because the recommended way of switching from a beta is to format and reinstall. Fortunately the uninstall actually worked starting with RC0
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
I've got the solution!
Thanks in advance to everybody who tried to help in anyway.
The solution is to recover a bug on the uninstallation program of the Beta version, it's all explained on:
Q312115 - PRB: Visual Studio Debugger Stops Responding After You Install Post-Beta 2 Build
It's about a service called ".NET Framework Support Service" which is not removed during the uninstall and produces all this problem. You must only to disable it and reinitialize the computer (find it at the Control Panel - Administrative Tools - Services, and disable it through Properties window).
Thanks to everyone.
Edgar
Edgar Berengena Moreno
Software Engineer
Appeyron Research
|
|
|
|
|
In the good old days, when I wanted to associate data structures with a combo-box item I'd use SetItemData.
What is the best method to do this in C# as I can't seem to find a SetItemData method. (Why has MS decided to remove a valuable, tried and tested way).
I must be missing something, I've been through the docs on ComboBox.ObjectCollection but it isn't making sense.
Michael
Time flies like an arrow. Fruit flies like a banana
|
|
|
|
|
i had to do the same thing with my ListEx[^] class, but wasnt sure how to do it. TO get around it, i made an ArrayList, and made a function as part of the class Add that added the relevant information to the Items collection, and also added a stuct of data to the ArrayList.
The position of the struct data in the ArrayList, corresponds to the position of the Item in the Items collection.
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
That's a little too hack and slash for my tastes. Especially when sorting, removing and inserting are taken into account.
The ListView control uses the Tag property, but I can't find a way of doing the same for combo-boxes.
This is very annoying, seeing much used functionality being deprecated by .NET
Michael
Time flies like an arrow. Fruit flies like a banana
|
|
|
|
|
|
Make the object you want to associate with the list item override the ToString() method. In ToString(), write code that will spit out the string that represents that object in the list box. Then just add your objects to the list (or combo) via the Items.Add() method. Then use the list (or combo)'s .SelectedItem property to get a reference to the object that is selected.
--
Russell Morris
"Have you gone mad Frink? Put down that science pole!"
|
|
|
|
|
Cool solution. I like it.
A little more work than SetItemData used to be, but it is the best idea so far. Thanks.
Michael
Time flies like an arrow. Fruit flies like a banana
|
|
|
|
|
I am trying to use some functions and structs from Shell32.DLL in my C# project. I have VS create a RCW by adding the COM DLL to my project references. However, after doing this I can only see the Classes, Interfaces, and Delegates from the DLL; I can not see the functions or structs. (Or any of the other NON-CLASS related items)
I understand I can use DllImport to extern the functions I want, but I could not figure out how to use DllImport to extern the Structs I want.
I do not care which method I use to gain access to the features I want of this DLL. If anyone can point me in the right direction, or just flat out let me know how to do what I want.
Thanks in advance…
Aalst
|
|
|
|
|
Well you'll have to code the structures by hand, below is an example
using System;
using System.Runtime.InteropServices;
namespace OSInfo
{
class Class1
{
[ StructLayout( LayoutKind.Sequential )]
public class OSVersionInfo
{
public int dwOSVersionInfoSize;
public int dwMajorVersion;
public int dwMinorVersion;
public int dwBuildNumber;
public int dwPlatformId;
[ MarshalAs( UnmanagedType.ByValTStr,
SizeConst=128 )]
public String szCSDVersion;
}
Each unmanaged DWORD corresponds to a managed int. The embedded fixed-length string TCHAR szCSDVersion[128] must be marshaled by value. The MarshalAs attribute can set the type of string marshaling to use as well as the length of the string. The most appropriate unmanaged type for this case is ByValTStr, which was designed specifically to be used for in-line fixed length character arrays that appear within a structure.
Note the StructLayout Attribute and the MarshalAs Attributes. You'll need to refer to MSDN to find out which UnmanagedType you need to Marshal you Data Members as.
Hope this helps.
May the Source be with you
Sonork ID 100.9997 sijinjoseph
|
|
|
|
|
This answer is great and fine. It deserves a good article on CodeProject, since I believe many people are going to get caught by this marshalling frenzy.
Btw, the MSDN doc completely sucks about this topic. It is barely a reference for internal MS people,
And I swallow a small raisin.
|
|
|
|
|
Agreed.
I think I have an easy solultion.
When defining structs , use the Platform Invoke Types table, but DWORD dont have to be uint like WORD dont have to be ushort, all u need to make sure is the width (bit size) corresponds to c++ unmanaged width.
EG: DWORD is 32bits wide, so u can use uint or int, whatever suites your needs. Int seems to be the prefered for DWORD and short seems for WORD. This seems logical as unsigned intergers will just require alot of extra casting.
However, I am not so sure about return values from functions e.g BOOL , which is 32bits wide, but i'm not really sure about the width of a Managed Boolean.
Hope this helps.
PS: Anyone who has some good experience with this might wanna write a comprehensive article for us C# only dummies .
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
What users would really love to see IMHO is a table with a mapping between C types (BOOL, HWND, DWORD, LPSTR, BSTR, SAFEARRAY, ...) and the corresponding managed type,
And I swallow a small raisin.
|
|
|
|
|
StephaneRodriguez wrote:
What users would really love to see IMHO is a table with a mapping between C types (BOOL, HWND, DWORD, LPSTR, BSTR, SAFEARRAY, ...) and the corresponding managed type,
That is exactly what the Platform Invoke Data Types table provides, but again like alot of MSDN, not clearly
For those that cant find the table: ms-help://MS.VSCC/MS.MSDNVS/cpguide/html/cpconplatforminvokedatatypes.htm
Sorry I dont have a weblink
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
|
I have a new idea
Now that we have the table of all simple types, and rules for structures, interfaces, enum, ... a great new little thingie would be a Marshall replace tool that takes for instance the WIN32 API method call as input in an edit box, and returns the equivalent call in managed code. Doing this, people will stop losing their valuable time wondering how to do it.
I guess that's time to explore VS.Net addins...
And I swallow a small raisin.
|
|
|
|
|
I was thinking of starting a project on converting all of the SDK headers into enums and structs and DllImported functions by running them thru a parser, but it just seems to be alot of work for one person...but if I can find a couple ppl to help, then we can do it !
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
In fact, the tools for conversion are already there. For instance, TLBIMP converts an IDL interface to a marshalled managed interface. All we need to do, when facing a WIN32 method call to be translated, is wrap it inside a fake IDL file, and launch TLBIMP.
The beauty of it is that I believe TLBIMP can be run seamlessly inside a C# app.
Once done, just launch ILDASM, it shows the marshalled managed interface.
Well, may be not everyone will agree that's simple enough ,
And I swallow a small raisin.
|
|
|
|
|
But this seems to be only for COM and not for unmanaged functions. Ideally what I want is a tool to convert any header file into static structures accessable via C#.
EG: nice.dll comes with nice.h and is NOT a COM dll, then all I need to do is run header file thru tool and TADA there is all the functions from library. It will still be up to you to implement your own managed structure implementation.
BTW TLBIMP gets autoinvoked when referencing a COM dll in a project, so it is transparent to the user .
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
IDL is 90% a wrapper on top of unmanaged functions, that's why only a few types MAY not be translated. But you're right in the end, a nice automatic tool with no IDL sh*t at all is just as well. I am thinking about it,
And I swallow a small raisin.
|
|
|
|