|
// Write the DIB header and the bits
file.Write( lpbi, lpbi->biSize );
check these above line of ur code
In ur Submitted code , u have created this DIB header,
Which states that the BMP u created is DIB,and let me know if u the file extension is .bmp then that means u have created an DIB image , thats why LoadImage fails.
Check few artilces for .bmp files , u can see these Windows supported Picture files are Device independent.
Even if u used the GetBitmapBits , but while saving u converted it into DIB
Regards
Abhishek
http://www.prepressure.com/formats/bmp/fileformat.htm
Abhishek Srivastava
Software Engg (VC++)
India ,Noida
Mobile no 9891492921
|
|
|
|
|
My file extension is .DIB not .bmp.
It works for some images but for some images it doesn't.
|
|
|
|
|
Well the extension doe'snt matter,
what i think is that u r saving it as DIB
and even ur extension says it is a DIB ....
try to read it as a DIB image may be it will solve ur issue!!
Abhishek Srivastava
Software Engg (VC++)
India ,Noida
Mobile no 9891492921
|
|
|
|
|
Yes, I am wrong.
Could you please tell me how to save the DDB data?
I need to use the DDB format because DIB takes DWORD.
|
|
|
|
|
hello
i want to convert hexa data to ascii or the string format in vc can u tell me any thing for this
regards
|
|
|
|
|
long x=0x2d13a54f;
char buf[1024];
sprintf(buf,"%x",x);
after run
buf=="2d13a54f"
|
|
|
|
|
Simple and sweet answer
The World is getting smaller and so are the people.
|
|
|
|
|
In VC, on the Window Menu, there are a couple of options, Next Window, Previous Window, and Close All. I have been trying to figure out how they do that, and have search through hundreds of project files and came to this conclution. Almost No One uses the Close All function.
Welp, I must be dumb, but I can't figure out how they do that. Anyone here know how?
LOSTTWARE.com
|
|
|
|
|
ummmmm by iterating thru the doc-template docs and views?
"there is no spoon" biz stuff about me
|
|
|
|
|
I know that, I have tried fifty different things, I just keep getting the code wrong. I was currious if any one knew of an example project, that had it, or just new the code for it.
LOSTTWARE.com
|
|
|
|
|
try GetFirstDocTemplatePosition() and all the associated functions for the template itteration
then GetFirstDocPosition() for the actual docs in a particular template
go from there
its really only 10 lines of code
"there is no spoon" biz stuff about me
|
|
|
|
|
How can add a new line of characters in the Edit Box control?
shenthil ( senthilkkumar@rediffmail.com)
|
|
|
|
|
|
i want to draw an irregular window with mfc. the requirements list below:
1. the irregular window based on SDI or MDI or Dialog;
2. the irregular window appears automatically when i start the program;
3. the shape of the window is according to a inputted picture. some color wish to be ignored, for example: white, then the part of the picture i wanted becomes irregular;
4. the edge of the irregular window is smooth, i mean that there is no unexpected color around the window;
5. if i moved the window, there is no rectangle made up with broken line around the window.
Could anyone show me how to draw it? i wish a details method. if possible, could anyone give the resource codes?
thanks a lot
|
|
|
|
|
Hi ,
There is an API called SetWindowRgn(), look this API in MSDN.using this API one can create a window
of any shape and size.u can create a CRgn Object, which holds the shape information of your window.
and passing this Object in the above API u can create a Window of ur desired shape and size.
Regards
Abhishek Srivastava
Software Engg (VC++)
India ,Noida
Mobile no 9891492921
|
|
|
|
|
I had builded my application with html context-sensitive Help, according to an article in msdn.microsoft.com "Displaying Context-Sensitive Help". It works but sometimes there was a "debug assertion failed" message box appeared, it said:
Program: ....
File:wincore.cpp
Line:875
and line 875 in wincore.cpp is( in void CWnd::AssertValid())
ASSERT(::IsWindow(m_hWnd));
I don't know why. Who could help me? Thanks a lot.
The help function in my application as following:
BOOL CMyFormView::OnHelpInfo(HELPINFO* pHelpInfo)
{
DWORD dwHelpID[] =
{
IDC_DOSESCALE_SELGRAY_STC_ADJUSTPANE, 0x61000,
...
0,0
};
if (pHelpInfo->iContextType == HELPINFO_WINDOW)
{
return HtmlHelp(
(HWND)pHelpInfo->hItemHandle,
"MyHelp.chm/ctrlhlp.txt",
HH_TP_HELP_WM_HELP,
(DWORD)(LPVOID)dwHelpID)
!= NULL;
}
return TRUE;
}
In ctrlhlp.txt:
.topic 0x61000
help text for control 0x61000
|
|
|
|
|
I am looking how to measure the performance of the set.h file in the Standard Template Library. This is for a homework assignment. We are required to modify the set.h file with global integer variables to do the following:
I need to know how to count the number of compares and data moves that take place when loading N number of strings into a set or multiset. I tried to open up the set.h and increment counters in a few places, but I have no idea which functions do what. The set.h file is very confusing to me.
Any help is appreciated.
|
|
|
|
|
i've declared int iGlob in a header file. then get error:
error C2039: 'iGlob' : is not a member of '`global namespace' for this code:
void myGlob()
{
::iGlob = 123;
}
why?
|
|
|
|
|
Did you extern the global variable in that .cpp file.
The World is getting smaller and so are the people.
|
|
|
|
|
i tried
extern "C"
{
#include "_Globals.h"
}
and
extern int iGlob; in cpp file.. but no luck.
i know this is probably trivial stuff,
how about an example?
.cpp file: ...
.h file: ...
Dlg file: ...
thanx
|
|
|
|
|
i dont konw which compiler you are using but this works for me.
---in global.h----
extern int uGlobal;
---in global.cpp---
int uGlobal;
---place where you will need that variable---
#include "global.h"
void somefunc()
{
uGlobal = 55;
}
all the files must be in the project, compiled and linked.
Hope i got you rite and answeredit correctly.
The World is getting smaller and so are the people.
|
|
|
|
|
found the solution on CP's FAQ....
6.2: How do I share a global variable among my .CPP files? (top)
First, in one of your .CPP files (and only one) declare the variable at global scope (that is, outside of all function and class definitions). For example:
int g_volume;
Then in a header file that is included in all .CPP files - such as stdafx.h - add an extern declaration:
extern int g_volume;
The extern keyword tells the compiler that g_volume is an int declared in some other .CPP file. If you forget the first step, the linker will give an unresolved external error.
|
|
|
|
|
Is it redistributable?
--
Must I be the meat in an imbecill sandwich?
|
|
|
|
|
It's part of windows - it must be totaly redistributable.
|
|
|
|
|
AK wrote:
It's part of windows
It's not part of Win9x/ME, so it might not have been redistributable. But it so happens that it is redistributable.
|
|
|
|