|
If you are using Data Access then MDAC 2.7 also needs to be installed.
May the Source be with you
Sonork ID 100.9997 sijinjoseph
|
|
|
|
|
Is it possible to serialize an Exception derived class? When I try to add an exception to a System.Messaging.Message object (which internally serializes the object to XML) I receive the following error:
System.InvalidOperationException: There was an error reflecting 'Send.DALException'. ---> System.InvalidOperationException: The property 'Source' on type 'System.Exception' cannot be serialized because it is decorated with declarative security permission attributes. Consider using imperative asserts or demands in the property accessors.
What does this mean? Can I get around it?
|
|
|
|
|
I'm giving a talk on GDI+ (which I know) and am looking for a comparison with DirectX.
Does anyone have any links or maybe some points for me to ponder on?
Cheers,
Simon
"VB.NET ... the STD of choice", me, internal company memo
|
|
|
|
|
It's a bit like comparing a car with a plane. Both are modes of transport, but used for different things. DX is faster than GDI+, and it's also harder to use. It's notoriously hard to set up, especially in 3D. DX also includes modules for playing sound, movies, and networking.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
What tool or product do you recommand to create a program that installs a .NET Windows Form component?
Does Microsoft provides one such tool with the .NET SDK?
|
|
|
|
|
There's the Windows Installer projects that are seemlessly integrated with VS.NET. You can even assign your build outputs, sources, content, etc. to directories and what-not. If you really don't mind learning the internals of the MSI database, you can get free tools in the Platform SDK, but you have to do almost everything yourself. Otherwise, you could go with commercial solutions.
Another options lies in the System.Configuration.Install namespace, where you use and create installer classes that can do about anything, from installing Windows Services to VS.NET toolbox items to custom CodeGroups. To use these, you use installutil.exe [options] MyAssembly.dll . InstallUtil.exe is a utility in the .NET SDK.
There are other free solutions out there, but none with support for .NET assemblies that I've seen. I recommend either the Windows Installer projects in VS.NET or writing custom installers like I also mentioned.
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
Thanks very much for these informations.
Just another question: where can I find the Windows Installer projects in VS.NET?
|
|
|
|
|
If you need a sample Windows Installer project, you can try Desktop Bob[^]
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
Add a new project to your solution (with your existing project, making build outputs available to your setup project) from the Deployment category. There should be several options available to you. Use the wizard if you're not sure about what to do. It does quite a bit for you.
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
Thanks. The Deployment wizard seems to be a very good starting point. It is a good surprise for me. Until now, I had not noticed its existence.
|
|
|
|
|
Converting an Icon to an Image is easy: Image img = ico.ToBitmap() - except when you need alpha blending. After digging through the IL for Icon.ToBitmap(), the concept is simple and helped me find some .NET docs that discussed off-screen rending with alpha channels. The following code should work:
Image img = new Bitmap(16, 16, PixelFormat.Format32bppArgb);
Graphics g = Graphics.FromImage(img);
g.CompositingMode = CompositingMode.SourceCopy;
g.DrawIcon(Icon.FromHandle(hIcon), 0, 0);
g.Dispose();
If I display img in a PictureBox or draw it in a form's graphics object, the alpha channel is all black. If, instead, I draw the icon directly on the form, the alpha channel is blended accordingly.
I've also tried filling the graphics object for the Bitmap img with SystemColors.Control (default for Form, etc.) and then drawing the icon after setting the compositing mode, but that doesn't work either.
Has anyone successfully done this? I'm trying to make a wrapper component for SHGetFileInfo which works pretty well except for the whole alpha blending problem described above. TIA
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
After some digging, the problem is not so a Graphics problem as it is a common controls problem. In order to get the icons to appear with the alpha channel, you have to use a .manifest file for the application as I described in one of my tutorials (just didn't realized that applied to alpha-blended icons, although I now understand why - the list control needs to be the CC6 list control).
Now my problem is only having one particular assembly redirect to CC6 in the Windows XP SBS cache, but despite what the MSDN docs say regarding SBS, this doesn't seem to work for DLLs without having a coresponding .manifest for the EXE (which makes a lot of things appear wrong). .NET assemblies must not use an Activation Context (in the Win32 part of the loading process) like SBS assemblies do. Any ideas of how to make just a DLL use the manifest file or resource (RT_MANIFEST) without forcing the application to?
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
I'm using OleDbDataApapter, et al to access an MS Access database in a C# application.
I have created form with various data bound controls for form-based record navigation.
However, when I try to update the database from the current changes in the data set I get an OleDbException indicating that the UPDATE Statement is invalid. Is there a way to get at the actual statement that is sent to the database?
I know you can get the UpdateCommand text, but this has placeholders for the parameters. If I can see the actual SQL command, then I can fix the problem, it's just a matter of getting hold of that SQL.
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
I'm seeing a lot of tutorials etc for .NET only in C#..
Would it be wise to switch to C# from VC++? In theory anything
in C# can be made in VC++ right?
|
|
|
|
|
In theory
Still, you have to know what you're trying to accomplish. For most purposes, C# is the language of choice for .NET. It should be fairly easy to learn the syntactic and language idioms of C# if you come from the C++ world (as I have.) The question is what usefulness/features do you get if you choose a particular language?
C#, IMHO, is a clean language. C++-esque syntax, with lessons learnt from Java and others, rolled into a beautiful construct. C#, obviously doesn't give you as fine-grained control as C++ using the Platform SDK, but there are plenty of Managed Classes that get you there without having to do a lot of the SDK work (for example, performance counters, network, or crypto.)
C++ is still in the hearts of many a code guru. Sometimes you don't need to use managed code, but there are things that are more difficult in C++ than in C#.
So is it wise? Learning is always wise.
"Good programming is language neutral, and is often more difficult to learn than a new language - after all, it's just syntax."
|
|
|
|
|
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
|
|
|
|