|
http://www.codeproject.com/property/hacking_the_cpropertyshee.asp[^]
The buttons are there on the modeless sheet, they are just hidden and disabled and the sheet is resized to remove the area where the buttons are. You have to expand the sheet, and then show and enable the buttons.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Thank you very much!
It works.
Lisoft
|
|
|
|
|
I want to be able to access the different layers in a photoshop file.
And then blit a specifique layer to a bitmap.
Does anyone knows how the data/layers are managed!
I havent found anything searching the web!!!!!
But there must be many that knows how to play with the layers, as you have to know that if you want to make a plugin for photoshop.
Anyone got a clue?
BTW I want to do be able to use this to make a skin using layers produced in
photoshop...
Cheers Dani
|
|
|
|
|
For example, if GetTextExtent returns 65, does it mean 65 pixel or 65 mm or 65 logical unit?
thanks
I am flying
|
|
|
|
|
Do I need to modify the button to a owner-draw one?
I overload the WM_CTLCOLOR,however,it doesn't work.
if (pWnd->GetDlgCtrlID() == IDC_BUTTON1) {
pDC->SetTextColor(RGB(255, 0, 0));
pDC->SetBkMode(TRANSPARENT);
}
why?
thanks!
|
|
|
|
|
I have an enum as a member in a strcture in c++.
I want it to be aligned to 16 bit and not to integer.
Is there any way i can force the compiler to aligen the enum to be 16 bit size?
|
|
|
|
|
The enum does not affect the size of your structure, since it defines a type used by the class/structure and not a member of the class.
If you have a member declared as so:
MyEnumType m_Type;
Then that declared member will affect the size of the class.
In any case the enum values are machine size words, which is an interger value size. Of course this is compilire dependent, a compilire that thinks the machine word size is 16-bits will use 16-bits for enum types.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Hi, I am trying to change the color in a bitmap.
I have used :
hbm = CreateDIBSection( NULL, pbmInfo, DIB_RGB_COLORS, &lpBits,
hSection, dwOffset );
DWORD *data=lpBits;
to get the pointer to the pixels.
Then I try to set all the pixels to red using this code:
lPitch= (((24*bmInfo.bmiHeader.biWidth + 31) & (~31))/8); //pitch in bytes
for(y=0;y<bmInfo.bmiHeader.biHeight;y++)
{
for(x=0;x<bmInfo.bmiHeader.biWidth;x++)
{
data[x]=0x00ff0000; // fill pixels with red color
}
data+=lPitch/sizeof(DWORD); //sizeof(DWORD) = 4
}
But when I save the bitmap I get a bitmap with some striped pattern.
I am using 24 color bitmap.
Perhaps the pitch is wrong, but I cannot see any wrong with it?
Does anyone has a clue, what might be wrong?
Please help, thanks Dani
|
|
|
|
|
This should work for for 24-bit bitmaps.
DWORD dwBitsPerPixel = bmInfo.bmiHeader.biPlanes * bmInfo.bmiHeader.biBitCount;
DWORD dwByteWidth = (((bmInfo.bmiHeader.biWidth * dwBitsPerPixel + 31) & ~31) >> 3);
DWORD *data, *pLine=lpBits;
RGBTRIPLE color = {0,0,0xFF};
for( y=0; y<bmInfo.bmiHeader.biHeight; ++y, pLine += dwByteWidth )
{
data = pLine;
for( x=0; x<bmInfo.bmiHeader.biWidth; ++x, data += sizeof(RGBTRIPLE) )
{
*(RGBTRIPLE*)data = color;
}
}
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Thanks,for your reply.
I get an error
cannot convert from 'void *' to 'unsigned long'
when using :
DWORD *pLine=lpBits;
So I tried to use: pLine=(DWORD*)lpBits;
instead.
But I get an exception somewhere in the for loop!
So the code has to access something outside the pixelbits area?
I dont know what might be wrong, do I have to use another cast from the void* pointer?
Regards, Dani
|
|
|
|
|
Whoops! SHOULD BE:
BYTE* pLine
:-OI am very sorry about that! I've spent the last 2 weeks using a library where almost every variable is either a DWORD or HANDLE.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
In a 24 bit bitmap, every pixel is stored in 24 bits but every row is aligned on a DWORD (32 bit) boundary. So in your loop when you reach the end of a row, you have to reset your pointer to the next 32 bit offset from the start of the bitmap data.
BYTE *dst=(BYTE*)pBits;
for (int dh = 0; dh < bm.bmHeight; dh++)
{
for (int dw = 0; dw < bm.bmWidth; dw++)
{
dst[0]=(BYTE)nBlue;
dst[1]=(BYTE)nGreen;
dst[2]=(BYTE)nRed;
dst += 3;
}
dst = (BYTE *)(((DWORD)dst + 3) & ~3);
}
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
That's much better than mine!
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
I want to know where I have to write the to the registry so a certain type of extension will be opened with a certain program and a way to write there certain parameters for my app.
I am desinginig a win32app and I want to know how can I have some argument vectors for it.
gabby
|
|
|
|
|
Figure it out yourself. Make a new file with a new extention, try .xyz Try open it. Select always open it with some program. And then check the regedit.
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
I always setup file associations in my apps installer. That way the associations are removed along when the app is uninstalled. The installer I use, InnoSetup, as a FAQ page that lists the registry entries needed to set up file associations: http://www.jrsoftware.org/isfaq.php#assoc[^]
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Problem description:
I realized my own Memory allocator that is returned by calls to "CoGetMalloc" function (i use a hooked function)
I created a DLL that on its initialization phase replaces the original memory allocator for the process (that loads this DLL), and points it to mine
i return a pointer to my memory allocator instead of the default one.
My memory allocator simulates the original, but uses my own heap.
here's what i do:
1. I use a DLL injector EXE application which injects a dll to a process - the DLL name is sent as a parameter.
2. i added "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\MyProcess.exe" to the registry,
and pointed it to the injector application with my DLL as its parameter.
The flow if what i expect to happen is this:
1. I execute "MyProcess.exe"
2. "MyProcess.exe" process is created and does nothing
3. The injector is executed, and injects my dll to "MyProcess.exe"
4. The injector activates the loadlibrary function which calls the initialization section in my DLL
5. This section hooks to the "CoGetMalloc" function, which uses my own memory allocator. (anyone who calls it, will get my memory allocator from now on
in this process)
6. the original "MyProcess.exe" is executed, but blindly using my memory allocator and heap instead of the default ones.
What actually happens is that i get a crash after few times the "Alloc" method is invoked, but i can't understand why. "Alloc" is the only method that
was called after launching "MyProcess.exe".
Can anyone see the problem with this scenario?
Thanks.
|
|
|
|
|
Hi,
I am developing Icon Editor Application in MFC. I have knowledge of handling bitmaps in MFC but I don't know how to handle Icons in MFC. Please tell me if there are any SDK for handling Icons in VC++. or I have to do it by using C. If I have to handle it by using C then tell me what is the format of Icons. Please help me in this regard.
Thanks in Advance.
Promise
If you have faith in the cause and
the means and in God, the hot
Sun will be cool for you.
|
|
|
|
|
I need variables which can have, beside a value, an empty and invalid state (like in DB's NULL etc).
With templates this is no problem to code this but I can't think of a short name for this?
template fancy<int> Parameter;
if(Parameter == fancy::valid)
{
}
|
|
|
|
|
If I understand your question correctly, do you mean you want to call your variables like this
class::variable
?
If yes, then simply make them static.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
No. You can safe for example values from 0 to 255 in a char. I need also the values 'empty' and 'invalid'.
Therefore I created a template, so I can declare a variable like: fancy<char> MyVar;
Problem is, I can't think of a name for the template.
|
|
|
|
|
I forgot to check: Do not treat <'s as HTML tags
fancy<char> MyVar
|
|
|
|
|
Hello.
Does anyone know how to upload files to web server through HTTP by VC++?
Thanks!
Help
|
|
|
|
|
|
Thank you very much!
Help
|
|
|
|