|
imariano wrote:
"Good programming is language neutral, and is often more difficult to learn than a new language - after all, it's just syntax."
I agree. It's a pity that most recruiters don't recognise this fact!
Kevin
|
|
|
|
|
Managed C++ is really a tool for integrating existing unmanaged C++ code and COM components into .NET. Although you can also use it to do new .NET development it's not particularly elegant and you also lack designer support for it, i.e., no drag and drop from the toolbox. (I gather this will be addressed in future versions - not sure if that means v1.1.)
It's far easier just to learn C# and use that for new development. You pretty much need to learn C# anyway, to get the most out of .NET (as you've noticed, lots of examples are only in C#), so you may as well use it for primary development, especially if you already come from a C++ background. Learning C# syntax is trivial. It's the .NET libraries and best practices, etc., that constitute the major learning paradigm.
Kevin
|
|
|
|
|
something to read about...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/drgui02132002.asp
I did hear that the new version of C++.Net will come with a design tool and a lot of syntax clean up. The release date is around Februry 2003.
|
|
|
|
|
That's good. I've not used MC++ yet but my initial forays into the documentation weren't pleasant! The syntax certainly could do with cleaning up!
Kevin
|
|
|
|
|
Help,
Dim tFileStream As System.IO.FileStream
Dim tStreamReader As System.IO.StreamReader
tPath = "C:\CYRILLIC_ENCODED.txt")
tFileStream = System.IO.File.Open(tPath, FileMode.Open)
tStreamReader = New System.IO.StreamReader(tFileStream)
"no cyrillic text" = tStreamReader.ReadToEnd
May be some one can help i get no cyrillic text using this code iv tried many different ways and no hope.
Thanks
|
|
|
|
|
Just a thought :
tPath = @"C:\CYRILLIC_ENCODED.txt";
Back to real work : D-27.
|
|
|
|
|
The default constructor for the StreamReader object uses the UTF-8 encoding. You need to use the appropriate encoding, e.g. iso-8859-5:
Dim tPath As String = "C:\CYRILLIC_ENCODED.txt"
Dim tFileStream As FileStream = File.Open(tPath, FileMode.Open)
Dim Cyrillic As System.Text.Encoding = System.Text.Encoding.GetEncoding("iso-8859-5")
Dim tStreamReader As New StreamReader(tFileStream, Cyrillic)
...
|
|
|
|
|
thanks a lot i will try that
|
|
|
|
|
It didnt work it still returning garbadge data and missing charecters.....
Im trying to open and html file and read the contents. When i open it in explorer and view the source the Encoding is Cyrillic (windows).
I have even tried to set the Regional setting to Cyrillic (at least thats what used to work for vb 6.0).
May be you got another tip regarding this.......
Thanks
|
|
|
|
|
actualy
Dim Cyrillic As System.Text.Encoding = System.Text.Encoding.GetEncoding("windows-1251")
was the one that recognized the encoding....
thanks a lot for the tip it was very helpful
|
|
|
|
|
I have an application that uses a custom image format.
What I am trying to do is make it possible to switch to
'thumbnails' in an explorer window, and have it show the thumbnails,
or when selected show it as a preview in the left pane (just like JPG's
and GIF's do already). How do I go about doing this? Just register the file type? or do I need to fiddle with the .net system.drawing.image encoder class?
Thanks!
|
|
|
|
|
Forgot to Add: I REALLY want this custom fileformat to be openable by
the 'windows picture and fax viewer' as well.
|
|
|
|
|
Why should it be anything different than standard listctrl thmubnailing such as the one detailed here[^] ?
Countdown Countdown before me becoming an Artech employee : D-28.
|
|
|
|
|
because I want the thumbnail to be in windows, not my own app?
Just add 'native support' for that certain fileformat so that
explorer.exe will display it in thumbnail mode.
|
|
|
|
|
Ok, why .NET then?
Browsing folders in thumbnail/preview mode is already slow. If you add .NET on top of that, nobody will stand it more than 30 seconds.
You are doing low-level here, and COM/C++ is the de facto language for that.
My 0.5 cent.
Back to real work : D-27.
|
|
|
|
|
I have a Windows.Form that handles events from an object that is executing on a different Thread. I use the following code (modified for posting) to handle events that use a custom EventArgs class:
Private Sub TheEventHandler(ByVal sender As Object, ByVal args As CustomEventArgs)
If Me.InvokeRequired Then
Me.BeginInvoke(New TheClass.CustomEventHandler(AddressOf TheEventHandler), New Object() {sender, args})
Else
...
End If
End Sub
This works fine. I use the following code (modified as well) for handling events that are defined using EventHandler and are passed EventArgs.Empty:
Private Sub TheEventHandler(ByVal sender As Object, ByVal args As EventArgs)
If Me.InvokeRequired Then
Me.BeginInvoke(New EventHandler(AddressOf TheEventHandler), New Object() {sender, args})
Else
...
End If
End Sub
When the code is executing on the non-GUI thread, the sender variable references the object executing on the other Thread (as it should since I fire the event passing Me as the source). However, after the "recursive" call to itself back on the GUI thread, the sender object references the Form that is handling the event. Why is the object being passed into BeginInvoke as the first item in the args array being replaced by the Form object? This doesn't happen in the case of non-EventHandler events (at least ones I created).
Any ideas?
I know I can get around it by just writing my own empty EventHandler delegate, but that seems silly...
|
|
|
|
|
I am using .NET Remoting to access a Class Library that I created in VB.NET.
This class library contains a reference to a COM + component that is used by
several functions. I am able to get the Remoting to work for most functions
but as soon as I try and call a function that is using the COM + component
the app freezes. I don't get any error messages, it just seems to hang. Is
there something I need to do in order to use a COM + component when
Remoting?
|
|
|
|
|
I am using .NET Remoting to access a Class Library that I created in VB.NET. This class library contains a reference to a COM + component that is used by several functions. I am able to get the Remoting to work for most functions but as soon as I try and call a function that is using the COM + component the app freezes. I don't get any error messages, it just seems to hang. Is there something I need to do in order to use a COM + component when Remoting?
|
|
|
|
|
|
I have a .NET service that creates multiple instances of the service from the same executable. According to the documentation I only require a single ServiceProcessInstaller class and a ServiceInstaller class for each instance of the server. This is true also for services that contain more than one service.
The problem I have is with using a user account to run the service. Setting the ServiceProcessInstaller.Account property to the user value and entering a password and login always yields an error during the installation process saying that the account/password combination is invalid.
Now the peculiar part - this only happens on NT4 boxes, Win2K and XP do not exhibit this problem. The number of instances of the service is controlled by a configuration file, setting the number of instances to 1 also causes the problem to go away.
I can find little or no information about this on either newsgroups or MS support pages. Can anyone else confirm this is actually more than a local problem that we have? Better still, does anyone know a solution to the problem?
Thanks,
Jason.
modified 10-Jul-19 21:02pm.
|
|
|
|
|
Hi all,
I have a windows application that uses remoting and is hosted in IIS. Its name is test.exe and the client config is called test.exe.config. They are both in the same virtual dir.
If I start it locally, the statement RemotingConfiguration.Configure("plato.exe.config"); executes fine and everything works.
However, if I start the application from its URL, i get a file not found exception: the config file could not be found.
The idea is: I start the application with its URL, the application should read the client config file that's on the server to get the remoting configuration out of it (instead of hardcoding it in the exe).
I searched but cannot find a solution for this. Anyone?
|
|
|
|
|
In a browser-based scenario, the HTML file must use the <link> element to explicitly point to the configuration file.
How low can you go ? (MS rant)
|
|
|
|
|
Thanks for the quick response. Could you give some details of how I should do that?
The html file looks simple:
Start Plato
In Plato.exe, there's a line with:
RemotingConfiguration.Configure("plato.exe.config");
and here it fails because config file is not found.
Thanks!
|
|
|
|
|
ref[^]
How low can you go ? (MS rant)
|
|
|
|
|
First, your "rel" attribute needs to have a value of "configuration", not just "config". Also, the default machine.config configurations don't allow any access to the "bin" subdirectory. Your application and it's associated .config file should be in a publicly-accessible directory.
Also, when you're dealing with Web-deployed apps such as we are (very, very big), make sure you run "gacutil /cdl" to clear the TAC (note: not GAC) from time to time, especially if you're not using automatically versioning in the AssemblyVersion attribute (we're not because of configuration headaches).
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|