|
A few points :
- If LoadImage returns 0, that's because it has failed. There is no point in passing 0 as a handle in the FromHandle() method.
- To know more about the error, you can use the GetLastError() WIN32 function.
- LoadImage can be used in either of the following ways. Trouble is you are using a mix of it! Namely,
-- If LR_LOADFROMFILE is provided as last parameter value (0x0010), like you do, then the second parameter is the actual filename of the image. Doing so, you are directly loading a .bmp, .ico, .cur file. But, from what you told me first you wanted to do, you should not use LR_LOADFROMFILE.
-- If LR_LOADFROMFILE is not provided, then the first paramter is the module instance of the .dll or .exe, allright, and then the second parameter is the resource name. You must pass the resource name : that is either the translated resource ID (use a resource editor) obtained with MAKEINTRESOURCE, or the direct resource name as a string.
MAKEINTRESOURCE is an int --> LPSTR macro defined as is :
#define MAKEINTRESOURCE(i) (LPSTR)((DWORD)((WORD)(i)))
|
|
|
|
|
.S.Rod. wrote:
MAKEINTRESOURCE is an int --> LPSTR macro defined as is :
#define MAKEINTRESOURCE(i) (LPSTR)((DWORD)((WORD)(i)))
I have no idea how to convert that to a C# statement (I think I am lost again):
int MAKEINTRESOURCE(i)
{
return Convert.ToString(Convert.ToDouble(i)));
}
.S.Rod. wrote:
If LR_LOADFROMFILE is not provided, then the first paramter is the module instance of the .dll or .exe
That is what I am doing, correct?
.S.Rod. wrote:
You must pass the resource name : that is either the translated resource ID (use a resource editor) obtained with MAKEINTRESOURCE, or the direct resource name as a string.
I see, I think, so I need to switch the 2nd param to a resource ID huh? I will check into that. Tell me something, am I making something simple, hard? I know a little about Win32, I just havn't worked with it a lot, VB shop at work. Thanks S.Rod. I appreciate it.
Nick Parker
You see the Standards change. - Fellow co-worker
|
|
|
|
|
Nick Parker wrote:
That is what I am doing, correct?
Unfortunately no. 0x0010 = LR_LOADFROMFILE, thus wrt this you should be passing a filename pointing to an actual .bmp, .cur or .ico file. Which you don't, since you are passing a .dll/.exe filename instead.
Nick Parker wrote:
I need to switch the 2nd param to a resource ID huh?
We are not talking about ConvertToString, which is the equivalent of VB's STR$().
MAKEINTRESOURCE makes an int looks like a pointer to a string. That's obtained by casting an int to an IntPtr.
At this point, you shouldn't bother that much about all this. Just lookup Cp, MSDDEV samples, and Google with either of those keywords : LoadIcon, LoadImage.
|
|
|
|
|
Can some tell me about his experience using mySQL with .NET? what are the advantages and disadvantages? any limitations or restrications?
I want to build a corporate application which will have a network access as well as remote access and I'm planning to use mySQL because of the limitation inb MS Access and SQL server with MSDE.
Many Thanks,
Jassim Rahma
Jassim Rahma
|
|
|
|
|
You should really only post things in one forum. Pick the one suited to your post the most and then stick with it.
However, I will tell you that dealing with mySQL in general is a pain for any form of Windows development. The myODBC driver that comes along with it is such a bother to configure. If you already have it, I'd stick with SQL Server. If not, I'd go with MSDE (a scaled down version of SQL Server).
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
Microsoft has reinvented the wheel, this time they made it round.
-Peterchen on VS.NET
|
|
|
|
|
Disclaimer: Although I use MySQL, I have not used MySQL with C#
That being said, MySQL does have an ODBC driver at www.mysql.com and there is a supported version (via MySQL AB) although you will have to ask for a quote, since in a corporate edition, this can get quite pricy.
... and my experience with C# and ODBC is quite good.
Regards,
Adrian
|
|
|
|
|
then, do you recommend mySQL for corporate application, or let me ask it the other way: which database you recommend for corporate if not MS Access and MS SQL server?
Jassim
|
|
|
|
|
Thats a good question. Since I am a consultant by day and programmer by night, I'll put my consultant hat on for you.
For small deployments, it really doesn't matter what you choose. I would recommend SQL Server simply because of the ease of deployment.
For larger deployments, where performance becomes an issue (and this point is dependent on the application and the environment), I tend to recommend Oracle.
For web deployments where the data is not as critical, or other programming languages (such as PHP or Perl) need to get involved, I tend to recommend MySQL.
I say "tend to" since I sometimes come across sites which already have a database in place, and that would have a bearing on the overall cost of the solution.
-Adrian
|
|
|
|
|
Any one knows what database hotmail.com service is using?
Many Thanks,
Jassim Rahma
Jassim Rahma
|
|
|
|
|
jrahma wrote:
Any one knows what database hotmail.com service is using?
If it's not SQL 2000, M$ would be busy with the conversion.
Cheers
Mike
Johannesburg, South Africa
|
|
|
|
|
I'd like to think so too, but there still seems to be a bunch of UNIX in the Hotmail backend.
I think Passport is the only pure MS part of Hotmail at the moment.
Cheers,
Simon
"The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter.
my svg article
|
|
|
|
|
(Disclaimer: I work for a company producing email products, but I have no insider knowledge of
hotmail.com beyond what I have read and heard over the years).
I'm not sure hotmail.com uses a database in the traditional sense of "database" beyond the Passport authentication. The messages are likely to be held in flat files. Email systems just don't work
the same way as databases in general. Even the now defunct Internet Mail Service from Microsoft held
each message in a single RFC-822 formatted file, with an index file for the meta-data.
However, a quick look at the SMTP servers indicate that they are now running Microsoft stuff on at
least some of their servers (It looks like Exchange 2K), and their web servers are running IIS, so
I guess that they are running Microsoft stuff now.
It should be noted that on an Exchange 2K server (at least my Exchange 2K server), I can change directory
to M:\sitename\MBX\ahall\INBOX and see a series of file <number>.EML. If I connect to the IMAP port,
then I see <number> appear as an IMAP UID. .EML format is the same RFC-822 format that their defunct
Internet Mail Service saved data as. So even in Exchange 2K, the database functionality is seriously
limited.
-Adrian
|
|
|
|
|
what are all the free installers available for .NET on the web?
Many Thanks,
Jassim Rahma
Jassim Rahma
|
|
|
|
|
I've made a setup project by Visual Studio.Net and the output is msi(windows installer). In Custom Action part, I've added some dll or exe projects. Now I want to trace the dll or exe projects, but I don't know how.
Can you help me please?
|
|
|
|
|
FileMon + Regmon (tools from the Windows Resource kit[^]).
|
|
|
|
|
Thanks.
But I couldn't find that. Can you tell more about it?
Mehdi.
|
|
|
|
|
|
Look at www.sysinternals.com for FileMon and RegMon
|
|
|
|
|
Hi!
i was designing my own comboBox (inherited class), but had some troube with it.
would you happen to now how one can change the height of the comboBox itself.
say my items are 10px eatch in height, how can i make that the height of the combobox as well
i tried to set FixkedHeight to false but thatdoesn't seem to work.
its interesting, becasue i can draw a combobox of anysize, but it seems that a clipRegion is predefiend so i can only see the default combobox of 18px heigh!
Thanks!
Ahmed k
|
|
|
|
|
If all elements are of fixed height, you must also set the DrawMode property to OwnerDrawFixed (instead of Normal, which is the default).
[edit]I have just been looking at the .NET combobox source code and it results from it that once an appropriate DrawMode is set, you just need to set the ItemHeight value you need to see it automatically reflected.[/edit]
If it gets to be full owner drawn, the technique then, inherited from good ol' WIN32 comboboxes, is besides doing .DrawMode=OwnerDrawVariable , to provide your implementation for OnMeasureItem(), and OnDrawItem(). Nish already made something available publicly[^] about it.
|
|
|
|
|
What I need is to get two applications to be able to communicate. I am very happy with IServiceProvider and System.ComponentModel.Design.ServiceContainer. They allow me to easily give access to my shared classes/components, to other classes. What I want now is to pass the IServiceProvider to the other application through remoting. All the objects that are added to the IServiceProvider are in their own Dll library. (I also referenced this dll library from the second application).
I created a remotable class (inheriting from Marshalobjbyref), that contains the IServiceProvider. (This remotable class is in a dll that is referenced by both applications) I published this remotable class with remoting. The second application is able to see the published class and call methods in it.
Here is the problem:
When I try to use the IServiceProvider - I get an error. It woun't let me use it. Is it possible to remote IServiceProvider?
IServiceProvider sure makes life easier for me, but I can't figure out how to use it remotely.
THANKS A LOT, if you can help me out.
|
|
|
|
|
I figured it out now.
Here's some help if anyone has the same problem:
- you can remote only classes that inherit Marshalobjbyref
- all objects that are passed/access in the class have to be serializable
- interfaces cannot be access in the class
|
|
|
|
|
i was just wondering. is it possible to find what type of encryption was used to encrypt a file. ? i have a program im working on that encrypt's decrypt's i want too add a "Auto detect" feature so they dont have to pick the algorithm it will detect it for them. do i have to use filestream with and write a small flag into the file to let me know what encryption was used (then erase the flag from the file and proceed with decryption) or does DES and RC2 have a unique identity that i can find inside each encryption too dectect that encryption.
im pretty sure the file stream would work...but im looking for a cleaner approach, i dont want to do it and find out theres a easyer/nicer way to do it.
thank you for reading this question.
Jesse M.
|
|
|
|
|
I don't think it's possible to detect the type of encryption that you used on a file without putting a little data somewhere in the file itself indicating which one you used. I think it would be very insecure to broadcast to everybody what encryption protocol you used.
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
Microsoft has reinvented the wheel, this time they made it round.
-Peterchen on VS.NET
|
|
|
|
|
thanks david. i wont do it.. i saw a guys source (it was a tourial) he had a way to detect if the file was encrypted or not.. i orignally though there was a way to detect which encryption was being used. but reviewing the code i do see that he added a flag into each file. it was a boolean number (011011 or something) while that does over some security... if i could crack that number and know that means "des" encryption to the program then someone else could too. anyways.. thanks agian.
|
|
|
|