|
I'm already overriding the LButtonDblClick handler, so I'd prefer not to override OnLButtonDown as it can cause conflicts.
Trivia: I'm also overriding OnNcRButtonUp to display a context menu, since OnContextMenu() no longer works since the OS thinks I'm always on the caption bar. I considered just adding a caption bar and menus, but that would ruin the flavor of the app (it looks like a toolbar).
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi,
I am currently trying to save a CBitmap to disc. And Have the following questions.
Is A CBitmap Always A DIB?
Is A HBITMAP Always A DIB?
Does anyone know any good resources for saving CBitmaps to disc?
I have been looking at the routines, on codeguru.com wrote the following code using them. All i get though is a blank bitmap.
HBITMAP testbmp;
testbmp= (HBITMAP) LoadImage(0,"C:\\orginal.bmp",IMAGE_BITMAP, NULL, NULL, LR_LOADFROMFILE);
CBitmap test;
test.Attach(testbmp);
WriteDIB( "C:\\two.bmp", DDBToDIB(test,BI_RGB,NULL));
The second parameter of DDBToDib is the compression, and the third is the palette, if no palette, is provided the default is used.
Anyone any clues where i am going wrong, all i get is a blank bitmap. I am using a 24bit BMP but tried tried with others.
Thanks Again
Richard
|
|
|
|
|
Is A CBitmap Always A DIB?
No.
Is A HBITMAP Always A DIB?
No.
Check the DIBLOOK sample in your VC++ help for bitmap-saving code.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Is A CBitmap Always A DIB?
Is A HBITMAP Always A DIB?
It's usually a DDB.
Does anyone know any good resources for saving CBitmaps to disc?
Plenty on the site. Look around.
I have been looking at the routines, on codeguru.com wrote the following code using them. All i get though is a blank bitmap.
HBITMAP testbmp;
testbmp= (HBITMAP) LoadImage(0,"C:\\orginal.bmp",IMAGE_BITMAP, NULL, NULL, LR_LOADFROMFILE);
This is not a DIB - you didn't specify LR_CREATEDIBSECTION.
CBitmap test;
test.Attach(testbmp);
WriteDIB( "C:\\two.bmp", DDBToDIB(test,BI_RGB,NULL));
The second parameter of DDBToDib is the compression, and the third is the palette, if no palette, is provided the default is used.
Anyone any clues where i am going wrong, all i get is a blank bitmap. I am using a 24bit BMP but tried tried with others.
I'd suggest that the problem is the flag I've pointed out. You also need when creating bitmaps to create a DIBSection. A DIBSection is a DIB that can be selected into a DC and attached to a CBitmap. There are good DIBSection wrappers here and on paintlib.de
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I need convert a integer in range 0-9999 to string in format of
4 bytes ,
for example:
34 -> "0034"
What can I do ???
|
|
|
|
|
use CSting.Format(, sprintf, or itoa (all documented in the help files)
|
|
|
|
|
char string[1024];
sprintf(string, "%04d", 1);
printf("%s", string); // 0001
|
|
|
|
|
Hi ,
I'm using hebrew enabled Win2K and when I enter my username in some dialog
the CEditBox shows some strange symbols ( gibrish - not english and not hebrew ).
I want to set somehow input language of this edit box to english - totally independant from system language.
I've searched MSDN , read this forum , tried this :
1)
// save the old locale
LCID oldLCID = GetThreadLocale();
2) SetThreadLocale(
MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT));
3) // set the old LCID one back
SetThreadLocale(oldLCID);
It didn't work and BTW it's only supported in Win NT
tried to play with nCharSet setting it to
ANSI_CHARSET 0
DEFAULT_CHARSET 1
SYMBOL_CHARSET 2
SHIFTJIS_CHARSET 128
OEM_CHARSET 255
etc.
Nothing worked.
Any help will be much appreciated !
Thanks,
Leon
|
|
|
|
|
Is there a way in VC++ to determine the drive name (volume label) for floppy drives, hard drives, CD-Rom drives, and network drives?
Thanks.
P.S. I tried GetVolumeInformation() and it works for the Floppy Disk 'A:', the Hard disk 'C:', and for the CD-Rom 'D:', but not for the network drives. Also, is there any way to determine if there is a diskette in the Floppy drive without trying to access it?
|
|
|
|
|
For network drives, use the WNetGetConnection function:
char cName[50];
DWORD dwLen = 50;
DWORD dwRes = WNetGetConnection("F:", cName, &dwLen);
dwRes will return NO_ERROR (0) if all is ok, and the drive's UNC name will be loaded into
cName. Any other value in dwRes indicates a failure. Use GetLastError() to determine the type of error.
Hope this helps.
|
|
|
|
|
Hi.
I'm beginner in MSMQ programming.
I have problem:
my workstation(NT4, WS, SP6, Independet Client of MSMQ) don't logon on domain with ActiveDirectory and MSMQ.
I use MSMQ API.
When I do MQOpenQueue(...) - result this function MQ_ERROR_SERVICE_NOT_AVAILABLE(Cannot connect to the Queue Manager).
Help me, please. I must Open Queue!!!
P.S. I'm sorry, but my English not good.
iLYA
Russian Software Developer
|
|
|
|
|
I've been tasked with developing an application that will automatically log a user off of a Novell Network after some number of time (say an hour). Right now, I'm thinking about simply monitoring the computer for inactivity (no keyboard or mouse events), but that doesn't seem right. I'd rather monitor for a lack of network activity, and if there is none after an hour, then I need to log the user off automatically. Which libraries and functions should I be checking out to develope this app? Thanks in advance for any suggestions.
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
If you have any smb-stations on the network, they will broadcast their presence sometimes. I would go for mouse/keyboard
|
|
|
|
|
Does anyone know of any software copanies or positions in the Portland/Salem, Oregon USA area that are currently hiring??
Thanks ~
|
|
|
|
|
Better question, are there any software companies in the entire US hiring?
I was actually thinking about this the other day. Does anyone know of any positions that have been filled in the last couple of months. I spent some time chatting with a recruiter I've known for awhile. He has been very fustrated by companies posting positions then pulling them after candidates have been submitted, or interviewing a few and then not returning emails or phone calls.
|
|
|
|
|
I started my current job on June 18. It has nothing to do with COM, XML, ASP, or anything close to being web-enabled. They just needed someone that could do MFC and C++.
Here's a little feedback on "recruiters". I don't really care for them. They are NOT genuinely concerned with getting you the best job to fit your skillset. They are concerned with getting you the best paying job, whether you are qualified or not. If they're just recruiters, they get a fee based on your hire salary. If they're from someplace like RHI or Maxim Group, they get at LEAST 95% of your salary as a fee for as long as you're contracted out.
They are NOT concerned with anything but how much money they're going to make off of you. They rip off companies who are desperate for qualified help and that would be be much better off financially by placing ads and going through the interview process themselves.
Maybe a good kind of company to have available is someone that merely conducts testing and first (and maybe even second) interview for potential employees, and pass on those who seem to be the best qualified. Charge a one-time fee on a per-interview process, and move on. That way, the company looking for the employee doesn't have to pay their existing high-dollar employees (managers and senior programmers) to conduct interviews themselves until a viable candidate has been weeded out of the stack.
|
|
|
|
|
Good for you on the job.
I agree somewhat about recruiters, they are just trying to make money like everyone else. However, they do cultivate the contacts and sometimes have the inside knowledge about positions that may be on the horizon. I have had bad experiences with some headhunters, but the few I do work with I spend the time to get to know them. I'm also not shy about telling the bad ones to get there bonus elsewhere and I've heard the "You'll never work in this town again." threat more than once.
I guess the bottom line is you have know and understand the nature of the relationship. The scorpian can't help stinging the turtle, it's his nature.
|
|
|
|
|
The only ones I've ever met admit (relunctantly) that they know NOTHING about software development, programmers, or the people that need programmers. How can you do that kind of job and NOT know what you're working with?
For the most part, headhunters are scum.
|
|
|
|
|
There's an ad in the Eugene Register/Guard this weekend for an MFC programmer in Springfield. Not quite Salem/Portland, but if you're in Salem in might work.
Ping me and I'll send you the particulars.
|
|
|
|
|
I know that the field offices for Microsoft are hiring (between 25-45% growth) if you look for a local branch and are good enough you might be able to get a job there.
Steve Maier, MCSD
|
|
|
|
|
Help: how to get a hard disk serial #?
|
|
|
|
|
Just making sure here, but if you are asking for the *volume" serial number (the serial number shown when you execute a "dir" command at a DOS prompt), you should be able to use ::GetVolumeInformation(...).
If you are looking for the serial number of the physical drive itself, I cannot help you there. There may be some BIOS or ATA commands to do it, but that is exceeding my expertise.
-=- James.
|
|
|
|
|
I am asking about the physical hard disk drive, but thank you anyway.
|
|
|
|
|
Use the following API : GetVolumeInformation().
Bye
Alex
|
|
|
|
|
...Can you tell me why some so-called "experts" on the board suffer a basic lack on knowledge, understanding, or experience?
Can someone please give me a reality check and take a look at the (sadly ongoing) exchange between "MichaelS" and me ("jtwine") at http://www.experts-exchange.com/jsp/qShow.jsp?qid=20172611 (it will cost 10 points) and tell me why is it that some people out there just do not "get it"?
IMO, this is the kind of person that the article "Unskilled and Unaware of It" (http://www.apa.org/journals/psp/psp7761121.html) talks about. I am of the opinion that "MichaelS" exhibits two of the traits of the unskilled: they cannot recognize competence in others, and they cannot recognize their own incompetence.
My major beef is that "MichaelS" fails to understand why the change that (s)he gave to the original poster is akin to handing a loaded gun to someone that does not know how to check their targets.
I think I am going to write an article about this kind of stuff and put it here on CodeProject!
Peace!
-=- James.
|
|
|
|
|