|
|
Why don't use
xyz()
{
m_BITMAPFILEHEADER.bfType=0;
m_BITMAPFILEHEADER.bfSize=0;
m_BITMAPFILEHEADER.bfReserved1=0;
m_BITMAPFILEHEADER.bfReserved2=0;
m_BITMAPFILEHEADER.bfOffBits=0;
}
Because, I don't remember if you could use ={0,0,0,0,0} in that point
Have a nice code day
|
|
|
|
|
My favorite,
ZeroMemory(m_BITMAPFILEHEADER, sizeof(m_BITMAPFILEHEADER));
if you want to set everything to 0.
Does not work if a class with complex objects is embedded wihtin the structure, such as a CString, however.
I can't believe how many times I have seen code setting data structure's fields to all zeroes, when there are several dozen fields, instead of block setting the entire element. If I only had a dollar...
No shirt, no shoes, no brains, no service.
|
|
|
|
|
I understand you!!!
This happens, really, too many times.
Have a nice code day
|
|
|
|
|
Hi everybody,
I need to implement Doc/View/Frame in an ActiveX control. I have tried to copy the code from a standart MFC Wizard generated SDI application in a standart Wizard generated ActiveX control, but it didnt work - all I could get was a bunch of crashes (for the document, I derived my class from COleDocument). Can anybody point me in the right direction. Any information is appreciated.
Thanks in advance,
Dennis.
|
|
|
|
|
hello,
i changed the background color of my dialogs in a dialog based MFC app by adding the following code:
SetDialogBkColor(RGB(150, 150, 150), RGB(0, 0, 0));
in my dialog based applications "Initinstance". However though the dialogs have all changed color, the background color of MessageBox() has not, and also the menu Button (Like File, Edit, Help) bar still follows the windows theme color. The menu options however show in white which is fine. I just want to change the background color of my messagebox and the color of my top menu.
Any pointers on how to do this?
"Some guys hack just to get themselves a girlfriend.What a pathetic reason huh ?"
|
|
|
|
|
Hi,
can anyone tell me how to use a bitmap as a background for my title bar? I have used a bitmap background for the dialogs and the title bar looks very out of place.
thankx
"Some guys hack just to get themselves a girlfriend.What a pathetic reason huh ?"
|
|
|
|
|
|
the content of a.txt as follows:
1121234 aaaaaa
2223 asdf
222fs adfa
....
how to write the data from a.txt into b.xls?
|
|
|
|
|
I don't know if this will solve your problem because I am not familiar with the .XLS format, but Excel also likes .CSV files. These are files with text values separated by commas:
1,3,5 = will appear in three columns in Excel.
You could insert commas between the values on the same line like:
1121234,aaaaaa<br />
2223,asdf<br />
222fs,adfa
etc and name it "something.csv".
this is this.
|
|
|
|
|
I insert commas between the values on the same line like:
1121234,aaaaaa
2223,asdf
222fs,adfa
and name it "a.csv"
the data separated by the commas are inserted into different cell in the "a.csv"
but I name it a.xls,the data of each line in the "1.txt" file are inserted into a cell.
How should I do?
Thank you.
|
|
|
|
|
Hi all,
I'm using MSXML to load and parse serveral xml files (quite obvious ). All works fine while the encoding of the file is utf-8 but when i load a file that has the following header
?xml version="1.0" encoding="UTF-16"?
i get an error telling that the encoding is not supported.
How can I load files encoded in utf-16?
Thanks in advance,
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
Hello
I have in my application a dialog with CHtmlView Object contained in it.This object allows me to open a html page within my dialog,this html page allows me to upload certain file(using some upload component).
the problem that i m facing is that as the upload is in progress if i close the dialog(which in turn kills the ChtmlView object)the upload is still in progress n still acesses the files(files to be uploaded),coz of which i cannot access these files later(sharing violation error).
ne solutions can let me know at shailesh@email.philnet
thanks
|
|
|
|
|
This one will be difficult-
Here's my situation:
The owner of my company is ultra-paranoid about wireless networks. We have a few notebook PC's that will be in and out of our office. He wants all of those to have some way of auto-disabling the wireless when connecting to our network.
I'd need to detect if they have a wireless device, detect if they are connected to our network (I could get away with connected to any network on a non-wireless if I had to), and find a way to disable the wireless.
Is there a way to accomplish this? I don't need a full solution - just some pointers if you can. I have a way to find the interface info. I can use pcap or I have another library that uses the MIB (I hope I'm remembering that acronym properly). I don't know if either can tell me if it is wireless though. I also don't know if there is a way to disable an interface from within a program.
Thanks for any help you may be able to provide. This one is really critical.
Dave
|
|
|
|
|
Hi All
I want to find all the running aplication on the system as windows task manager shows.
Please guide me.
Thanks
|
|
|
|
|
rajeevktripathi wrote: I want to find all the running aplication on the system as windows task manager shows.
Look for EnumProcesses.
|
|
|
|
|
rajeevktripathi wrote: I want to find all the running aplication on the system as windows task manager shows.
look for CreateToolhelp32Snapshot, Process32First, Process32Next
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Is it possible to get these to run *before* any other compiles are done?
Setting the project-level one seems to happen only after all other compiles are done. I want it to happen *before* - I don't care about dependencies or anything like that (it's actually a makefile which takes care of everything itself), it just has to always run.
Adding the makefile to the project and setting a custom build rule for it works a little better except that the IDE won't run it unless the makefile itself has changed. I found a trick [^] where setting a non-existent file as the output forces the build step to always be run but again, it happens *after* all other compiles
The only thing I've found to work is to add the makefile to the project (as described above) but also add additional dependencies so that the build step gets executed if the makefile will actually do anything i.e. I have to duplicate all the dependency rules that are already in the makefile. This is obviously a PITA...
The two most common elements in the universe are Hydrogen and stupidity. - Harlan Ellison
Awasu 2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
Taka Muraoka wrote: Is it possible to get these to run *before* any other compiles are done?
Yes,
Project / Settings / Custom Build (Tab)
In your VC++ 6.0 help you also find the article "Controlling the Build Process with Custom Build Rules".
|
|
|
|
|
Yah, but there's nothing there about getting the behaviour I want.
From here[^]: Per-file rules that you enter on the Custom Build tab run before the normal build-system tools (such as the compiler, the resource compiler, and so forth) are run.
So this gives me the custom build step *before* any other compiles are done. But I need it to *always* be run, regardless of any dependencies. That's the tricky bit.
This section[^] describes how to set up dependencies but I want to avoid having to enter all the dependencies into the project given that they are already in the makefile.
The two most common elements in the universe are Hydrogen and stupidity. - Harlan Ellison
Awasu 2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
Hi,
Can I use MSVC compilers & precompilers to compile my Pro*C programs?
If yes, how can I use MSVC compilers to compile Pro*C programs which contains Embedded SQL statements (eg. EXEC SQL INCLUDE emp.h;, instead of #include emp.h ).
- Manish
|
|
|
|
|
|
I am using SQl SERVER as database manager.
How can I test if the field of one table is NULL from my program. This field can be date,number or string. See this;
strCommand = "select * from tabreq ";
hr = req.Open(session, strCommand,NULL);
I want to verify that req.m_price is NULL, what to do?
I learn my self
-- modified at 4:41 Wednesday 21st December, 2005
|
|
|
|
|
Hi,
Can anyone plz tell me how to create a setup file(Project Deployment) for an application in VC++.
regards
Jeeva
|
|
|
|
|
jeeva
u need a softare known as
Installshield
creating setup for vc++ is quiet crucial tast
if the project is quiet complex then u need to
study the installshield .
Setup for VC++ is not as simple as for VB.
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|