|
Can this function declaration be converted to c++?
the function is calling a function with ordinal number 65 from uxtheme.dll
|
|
|
|
|
vikrant kpr wrote: DWORD Ordinal = MAKELONG(0, 65);
Your parameters to MAKELONG are in the wrong order. Documentation says:
For MAKELONG:
DWORD MAKELONG (WORD wLow, WORD wHigh)
And for the 2nd parameter to GetProcAddress:
If this parameter is an ordinal value, it must be in the low-order word; the high-order word must be zero.
Judy
|
|
|
|
|
Tried that as well
no luck
|
|
|
|
|
|
My app is crashing unexpectedly and I suspect that it is because of the CArray object I am using.
I have a CArray inside a structure, and I have an array of this structure.
For example:
struct type1
{
unsigned char variable1;
unsigned char variable2;
CArray<float, float> DataPtTable;
unsigned char variable3;
};
type1 myArray[5];
Now if I call myArray[2].DataPtTable.Add() or SetSize() , how is the memory allocated? I know it does get reallocated, but does that make calls to members of myArray[2].DataPtTable invalid since it is now pointing somewhere else? Or will it begin to overwrite into memory allocated for variable3, etc?
Thanks.
|
|
|
|
|
Are performing some operations like
type1 stMystruct1;<br />
type1 stMystruct2 = stMystruct1;
?
|
|
|
|
|
The array object remains valid. The memory allocations and reallocations are
internal to the CArray class. That's the whole idea - so you don't have to
worry about it.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
So the way I am using CArray is correct?
Then the app crashing must be something else. Dam, back to square one.
|
|
|
|
|
acerunner316 wrote: So the way I am using CArray is correct?
From what you've posted, yes.
I can't see the stuff in angle brackets though...
struct type1
{
unsigned char variable1;
unsigned char variable2;
CArray<float, float=""><span style="color: Red;"><???></span> DataPtTable;
unsigned char variable3;
};
type1 myArray[5];</float,>
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have two CArray objects.
One is <WORD, WORD>
Other is <float, float>
I know there isn't a problem with that part of the declaration.
|
|
|
|
|
In that case, looks like there's a problem elsewhere.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Where does the programm crash? Use the debugger and write us some previous lines with the point of your failure.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Hello,
I have a tab control, contents of which are displayed by a CDialog. This dialog contains different controls on it. I am having following issues :-
1) After I run my app, if I put another window on top of it (say calc.exe) and switch back to my app, I see the area convered by calc.exe is erased!
2) I have a menu which pops up if I do a right control on the header of my Clistctrl .. after the menu goes away, the area covered by the menu is erased and comes back only when I move my mouse over the area...
3) If I hit enter the contents on the tab control (which are displayed by CDialog) go away completely!
Thank you in advance for your help...
|
|
|
|
|
Hello,
You can try to use this message,
BEGIN_MESSAGE_MAP(CButtonDlg, CDialog)
ON_WM_ERASEBKGND()
END_MESSAGE_MAP()
BOOL CDialog::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
return CDialog::OnEraseBkgnd(pDC);
}
This member function is called to erase the background when any changes happens in window like resize or move.
I guess i will work.... Try this.... Good Luck...
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
santhoshv84 wrote: BOOL CDialog::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
return CDialog::OnEraseBkgnd(pDC);
}
This will not have any effect. This is same as you are not mapping it...
- NS -
|
|
|
|
|
Why did you repost, when my question was not answered yet?
See this[^]
- NS -
|
|
|
|
|
I have a problem with receive and send in MFC:
I have a program which named Server and a Client named program,After Client connect to Server and Two sides begin traslate data through socket,but when My Server goto receive before then Server Program error,I don't know a method to decide,please help me.
I live In VietNam and this is my homework,please help me
|
|
|
|
|
topic says all is there any?
thnx
|
|
|
|
|
there are dozens.
did you try searching this site? or Google?
|
|
|
|
|
i searched ... nothing , i wonder maybe i use bad key words !
|
|
|
|
|
actually i searched in articles for "jpg to bmp API" the answers was s.th else ! for example changing icons to ... !!! i also looked in my API book but i couldnt find , man plz hlp
|
|
|
|
|
If you don't need to write the JPEG decompression yourself,
here's the simplest way I know:
#include <atlimage.h>
...
CImage image;
image.Load(_T("c:\\some.jpg"));
image.Save(_T("c:\\some.bmp"), ImageFormatBMP);
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
do u know where can i get atlimage.h ??? CImage is a new class included with VC7 i think, but i use BC++
-- modified at 17:26 Thursday 25th October, 2007
|
|
|
|
|
V_shr wrote: CImage is a new class included with VC7 i think, but i dont use VisualStudio.NET
Ok, try this ...
ULONG dwToken;
Gdiplus::GdiplusStartupInput input;
Gdiplus::GdiplusStartupOutput output;
Gdiplus::Status status = Gdiplus::GdiplusStartup(&dwToken, &input, &output);
if(status == Gdiplus::Ok)
{
Gdiplus::Bitmap *pBitmap = new Gdiplus::Bitmap(L"c:\\some.jpg", FALSE);
CLSID bmpClsid;
GetEncoderClsid(L"image/bmp", &bmpClsid);
pBitmap->Save(L"c:\\some.bmp", &bmpClsid);
delete pBitmap;
Gdiplus::GdiplusShutdown(dwToken);
}
I took the GetEncoderClsId() function right from the GDI+ docs in the Platform SDK.
It looks like this:
int GetEncoderClsid(const WCHAR* format, CLSID* pClsid)
{
UINT num = 0;
UINT size = 0;
ImageCodecInfo* pImageCodecInfo = NULL;
GetImageEncodersSize(&num, &size);
if(size == 0)
return -1;
pImageCodecInfo = (ImageCodecInfo*)(malloc(size));
if(pImageCodecInfo == NULL)
return -1;
GetImageEncoders(num, size, pImageCodecInfo);
for(UINT j = 0; j < num; ++j)
{
if( wcscmp(pImageCodecInfo[j].MimeType, format) == 0 )
{
*pClsid = pImageCodecInfo[j].Clsid;
free(pImageCodecInfo);
return j;
}
}
free(pImageCodecInfo);
return -1;
}
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
thnx , here its 3:00 pm , ill try it tomarrow
|
|
|
|