|
Don't use out for the last parameter. A String is already a reference type. Also, when alloc'ing your myFileName variable, use '\0' (null) instead of a space. This makes sure that everything is properly null-terminated in case StrRetToStr does something differently.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I see, thanks Heath, it's running without incident now. However, my string is still unasigned after the StrRet call. The STRRET still comes out of the getName function with a type value of 0, and i'm sure that's wrong.
I played around with setting it manualy, but for values 1 and 2, it crashes, and for 3 I get a null string. I didn't think it would work, but had to try.
I can only think it would be the GetName method that's not working properly....
What are your thoughts?
Cata
|
|
|
|
|
Is there an easy way to draw a text on a path? Specifically if I have a curve and I want this text to go along that curve, how can I do that?
Thanks.
|
|
|
|
|
Werdna wrote:
Is there an easy way to draw a text on a path?
No. Lots of calculations and direct font manipulation (if you want to scew fonts) is required. Otherwise, you must trace along the path perpendicular to the normal and draw your fonts with the correct width (of each character, which requires quite a bit of calculations) and space between characters.
It's not as easy as it sounds (if you think this sounds easy). Photoshop CS just added text path support. It hadn't had it previously and there were only a few plugins available that provided such functionality. Just as an example.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks. That's what I thought. I got it to work on drawing on ellipse by using some math. It was a pain. Had to brush up on my trig.
|
|
|
|
|
I am designing an html redirector page now since the ip of my computer keeps on changing i developed an application to detect whenever there is a change in my computers ip address this ip address is stored in a variable in my application now i want to put this variable in html redirector page is it possible.
|
|
|
|
|
VIJAYPAPUPAGER wrote:
I am designing an html redirector page now since the ip of my computer keeps on changing i developed an application to detect whenever there is a change in my computers ip address this ip address is stored in a variable in my application now i want to put this variable in html redirector page is it possible.
If you are writing an application that requires a static IP then you should pay the extra money and get it, DHCP shouldn't be used when a static IP is required. That said, I suppose you could write a quick app that would poll your system for its IP address and store it in a hard file, whatever style you want, be it HTML, XML or your own flavor. It just doesn't appear to be a sound solution to your problem though.
- Nick Parker My Blog
|
|
|
|
|
In addition to what Nick said, you don't need to tell the ASP.NET application what your IP address is. It already knows. From with your page or control, just call Page.Request.ServerVariables["SERVER_NAME"] . This gets the hostname or IP address. There's other ways to get this, too, like Page.Request.Url.Host . If you like, the best place to store this would be in the Page.Application property - kind of like a session variables only they apply to the whole application so that the application can query the variables (like Page.Application["IPAddress"] ) and get the same thing everywhere.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
i want to distribute my C# app to a win98 platform... i installed the framework 1.1 redist on it and ran that app and this is what i get...
" ...some exception... cannot be handled.....[some process value]...[some thread value]..."
whats the conventional way of compiling an app to distribute?
isnt it simply , setting the mode to release instead of debug and then compile?
|
|
|
|
|
You can distribute a debug assembly. You just shouldn't. You compile like you normally would. C# compiles to Intermediate Language, which all .NET languages compile to. This is JIT'd into native code and executed on the machine, essentially like Java does. This is a fundamental concept of .NET.
Your error message helps none. Changes are you're using a class that only works on Windows NT. If you actually read the documentation as you develop (now there's a concept), the docs state which operating systems are supported. If you can't give us the full details to try to help you, then please don't post. This is as informative as something stupid like, "It doesn't work".
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
ok ok chill
my app cant be specific for NT(or for that matter any other) , coz its just a normal beginner c# app. i have used simple basic XML functions and general GUI stuff, so its nothing complex. but sorry for not informing you.
the err goes like ,
application has generated an exception that cannot be handled..
pid = 0xc70(3184) tid = 0xc78(3192),
|
|
|
|
|
Don't tell me to chill. When you post such an uninformative question, expect a uninformative answer. And yes, even some basic things (or things a beginning might think are basic) can be NT-only, like Opacity. You should understand what types you're using and members your calling. You'd be surprised at how much isn't supported on Windows.
This application exception looks more like a win32 exception, which means the .NET Framework isn't installed right. Was your application bult in VS.NET 2002 or 2003? 2002 only compiles for .NET 1.0, and 2003 only compiles for .NET 1.1. If you used the command-line compiler, which version did you use. While the .NET Framework is typically backward- and forward-compatible, it is not always.
Did you reboot after installing the framework? Is your app running locally or from across the network? There's code access security to take into account in those cases, although in Windows NT at least the message is different.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
.NET ent architect 2k2
i tried this out on systems running .NET 1.1 and 1.037, same err on both !
|
|
|
|
|
VS.NET 2002 builds for .NET 1.0, so make sure that .NET 1.0 (v1.0.3705) is installed. Since you said you did that, make sure you have the same service pack installed as you do on your system (you should have 1.0 sp2 installed). .NET 1.0 has not be released with sp2 included.
Finally, since it's Windows you must reboot. Even a few features in .NET require a reboot on Windows NT. It is a system-level component.
One other thing you can do (as opposed to using MessageBox , which is not a viable form of debugging and can't show you near enough) is to install the .NET Framework SDK on the machine and use cordbg.exe to step through a debug build of your application. Heck, for that matter, you can even try compiling your source using csc.exe that comes with the Framework (not the SDK). It will still compile whether certain Types or members are NT-only, but it could help determine if there are other errors when trying to compile your code (not necessarily with your code).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Ashwin C wrote:
" ...some exception... cannot be handled.....[some process value]...[some thread value]..."
whats the conventional way of compiling an app to distribute?
These errors are a pain in the ass to sort. First, I'd recommend building a default C# wizard generated application. See if that works. At least then you know that .NET is installed correctly on the Win98 machine.
If the basic app works, start commenting out code until your's starts working. (Alternativly, put a few MessageBox statements into your code flow and see how far it is getting)
You might want to try a Windows update and see if the 98 machine is missing any important updates.
Michael
But you know when the truth is told,
That you can get what you want or you can just get old,
Your're going to kick off before you even get halfway through.
When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
|
|
|
|
|
Welcome to the .NET world.
I have personally dismissed .NET at all for the time being. From the many blocking issues I have had with deployment, I claim that .NET is not ready for prime time.
Deal with it.
If you want frightening weblog posts from CLR guys, let me know.
RSS feed
|
|
|
|
|
I have a developers control that I need to build that will do the following:
Uses FileDialog to let the developer point to a DLL.
Exposes all classes defined within that dll (not working yet)
Then exposes all methods defined within the selected class (not started yet)
I tried creating an AssemblyInfo and getting its' members but that did not work. I tried doing a Reflection.LoadFile and all I got was that my member was typeof(AssemblyInfo) (arg)
What is the sequence of reflection commands that I use to expose the classes of a given assembly??? I am assuming that once I get down the a specific class, I can use Type.GetMethods() of that class to get its' public/static methods.
Thanks in advance!
_____________________________________________
Of all the senses I could possibly lose, It is most often the one called 'common' that gets lost.
|
|
|
|
|
theRealCondor wrote:
I have a developers control that I need to build that will do the following
Reflector[^] has already been written, it's a great tool and you can even use it to see how he has done what you are asking for.
- Nick Parker My Blog
|
|
|
|
|
Nick,
Thanks for the response, but I have used Reflector for a long time but that is not what I need. I am exposing an object configuration editor for our proprietary web engine. I am trying to create an editor that is launched from the propertyGrid in my application so that when a developer wants to define a new object to our engine, they do not have to type all of the XML by hand and run the risk of errors.
Thus, I need them to point me at the DLL. Then I can expose the classes. And when they choose the class I can issue a System.Type.GetMethods() to let them choose which method to execute. Then, when all of the information is selected via dropdown boxes, I can format the proprietary XML file to define this object to our web engine.
_____________________________________________
Of all the senses I could possibly lose, It is most often the one called 'common' that gets lost.
|
|
|
|
|
I was only suggesting that you take a look at the decompiled source for reflector within reflector to see how to do what you need as it does what you are asking.
- Nick Parker My Blog
|
|
|
|
|
Good idea!
Thanks.
_____________________________________________
Of all the senses I could possibly lose, It is most often the one called 'common' that gets lost.
|
|
|
|
|
See the Assembly class for a list of methods. Nick's right, though - why do something that several other people already have? And .NET Reflector has been in development for a couple years, IIRC.
You could also just use ildasm.exe, the IL disassembler that comes with the .NET Framework SDK. No decompilation, but any developer worth his/her salt should be able to read and understand IL, IMO.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
The reason I am doing it myself is because those tools do not take the selected results, put it into the XML file format that our proprietary web engines uses, and properly integrates it into the AppVarConfig and GlobalObjectConfig files of our application.
I have been reading through the Assembly class for a list of methods and quite alot of it is very genereric:
Assembly.SomeMethod returns the attributes of the instance.
Okay....are we talking the instance of the Assembly or the instance
of the object I am working with?
Are they talking about characteristics (like methods) or are they
talking about true attributes ([Description("")]) which I do not need?
_____________________________________________
Of all the senses I could possibly lose, It is most often the one called 'common' that gets lost.
|
|
|
|
|
Assembly represents your assembly. What don't you get about that? It contains modules, assembly attributes, and embedded resources all listed by a manifest. The Assembly class gives you programmatic access to all that.
If you wanted to get all public and protected Types in your assembly, use Assembly.GetExportedTypes . If you want the assembly attributes, use Assembly.GetCustomAttributes . If you want all types defined in the assembly use Assembly.GetTypes . Trying to get a reference to the Assembly instance? There's static methods to do that as well. You can also use obj.GetType().Assembly or typeof(MyClass).Assembly .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Make sure you use Assembly.GetExportedTypes to get the types...
Jonathan de Halleux.
www.dotnetwiki.org
|
|
|
|