|
The modal dialog is the main window in this sort of application. However, I'm still far from clear what you are really trying to do.
|
|
|
|
|
When you create the project choose Dialog Project in the options, this will give you a dialog applicaiton which I think is what you want.
==============================
Nothing to say.
|
|
|
|
|
|
I am wondering if someone has used an API or Toolkit to incorporate Anonymous Usage or User Experience into their product.
For exmaple, when you install Visual Studio, it asks if you want to participate in the Installation User Experience to provide feedback to Microsoft regarding your installation experience.
Other product have similar types of options, which basically come down to the application reporting back some information about how the inlstallation was operated, problems encountered, etc.
So if you have used or heard of such an API or toolkit to incorporate such features into an application, please respond.
Thanks.
I need a 32 bit unsigned value just to hold the number of coding WTF I see in a day …
|
|
|
|
|
hi all,
i want to load a png image from resource in picture control.
how can i do this.
thanks.
|
|
|
|
|
|
#include "atlimage.h"
Image* m_pImage;
char *pStr = strTempIMGPath.GetBuffer(0);
int size = MultiByteToWideChar(GetACP(), 0, pStr, -1, NULL, 0);
MultiByteToWideChar(GetACP(), 0, pStr, -1, szFile, size);
strTempIMGPath.ReleaseBuffer();
if (m_pImage != NULL)
{
delete m_pImage;
m_pImage = NULL;
}
m_pImage = new Image(szFile, FALSE);
void CPNGButton::OnPaint()
{
CPaintDC dc(this);
Graphics graphics(dc.m_hDC);
if(m_pImage != NULL && (m_pImage->GetLastStatus() == Gdiplus::Status::Ok))
{
graphics.DrawImage(m_pImage, 0, 0, m_pImage->GetWidth(), m_pImage->GetHeight());
}
}
|
|
|
|
|
i want to load png file from Resources not with using file path of any selected file location.
|
|
|
|
|
I event tried to load the PNG file from the resource. But I failed.
If you find the way, please tell me.
|
|
|
|
|
LPCTSTR szResourceName =MAKEINTRESOURCE(IDB_PNG1);
LPCTSTR szResourceType=_T("PNG");
HMODULE hresModule=AfxGetResourceHandle();
HRSRC hPicture = FindResource(hresModule,szResourceName,szResourceType);
HGLOBAL hResData;
if (!hPicture || !(hResData = LoadResource(hresModule,hPicture)))
{
TRACE(_T("Load (resource): Error loading resource %s\n"),szResourceName);
return ;
};
DWORD dwSize = SizeofResource(hresModule,hPicture);
HGLOBAL hGlobal = GlobalAlloc(GMEM_MOVEABLE | GMEM_NODISCARD,dwSize);
if (!hGlobal)
{
TRACE(_T("Load (resource): Error allocating memory\n"));
FreeResource(hResData);
return ;
};
char *pDest = reinterpret_cast<char *> (GlobalLock(hGlobal));
char *pSrc = reinterpret_cast<char *> (LockResource(hResData));
if (!pSrc || !pDest)
{
TRACE(_T("Load (resource): Error locking memory\n"));
GlobalFree(hGlobal);
FreeResource(hResData);
return ;
};
ULONG ulWritten=0;
ulWritten = 0;
CopyMemory(pDest,pSrc,dwSize);
HRESULT hr = ::CreateStreamOnHGlobal(hGlobal,FALSE,&pStream);
pStream->Write(pDest, dwSize, &ulWritten);
FreeResource(hResData);
GlobalUnlock(hGlobal);
Bitmap oBmp(pStream,0);
m_Image_ics.Load(pStream);
HDC memdc;
CRect rect;
this->GetClientRect(&rect);
HBITMAP hBmp;
oBmp.GetHBITMAP(0, &hBmp);
::SendMessage(png_bnr->GetSafeHwnd(),STM_SETIMAGE,IMAGE_BITMAP,(LPARAM)hBmp);
|
|
|
|
|
Hi,I want to write registry with Non - administrator account In MFC(vs2010),but failed.Can you have any idea to write registry.
|
|
|
|
|
There is a reason that parts of the registry can be only changed by administrators. To store user dependant information use the HKCU (current user) tree where you can write with user privileges.
|
|
|
|
|
In win7 ,When open UAC,it also cannot write registry,how
to avoid
|
|
|
|
|
The registry is like a file system with different access rights for the different keys. Navigate to your key using regedit and open the 'Permissions' command from the context menu to see the permissions for specific users and groups. Some keys have restricted access even for administrators (SAM, SECURITY). Such keys can be only accessed by the SYSTEM user.
So the answer to your question is: You must have the access rights which are usually granted when you open the key using the account of the key's owner.
|
|
|
|
|
HKEY_CURRENT_USER also cANNOT write
|
|
|
|
|
At the moment I know only two reasons for denied permissions when trying to write to HKCU:
- Using
RegOpenKeyEx() , the key was not opened with the KEY_SET_VALUE or KEY_WRITE access right. - Using
RegOpenKey() instead of RegOpenKeyEx() .
Regarding the second reason I will cite the MSDN:
Quote: The RegOpenKey function uses the default security access mask to open a key. If opening the key requires a different access right, the function fails, returning ERROR_ACCESS_DENIED. An application should use the RegOpenKeyEx function to specify an access mask in this situation.
If this does not solve your problem, you should show us the code that fails (including the RegOpenKeyEx() call).
|
|
|
|
|
How can I get CBitmap from CDib ? I have tried in follow way:
CBitmap Bitmap;
Bitmap.FromHandle((HBITMAP)pDoc->m_Dib->m_hBitmap);
doesn't work ... can you help me ? Thank you.
|
|
|
|
|
There are four GDI functions that can be used to converts DIBs to DDBs: CreateDIBitmap() , SetDIBits() , and SetDIBitsToDevice() , and StretchDIBits() .
Have a look at the Bitmap Basics - A GDI tutorial[^] article. The sources contain sample code to convert bitmaps.
Google will give you also a lot of results when feeding it with the above function names or 'DIB to DDB'.
|
|
|
|
|
Sir i have an base class which has an pure virtual member function..i have made it and also made other member function. now this is a general base class.i want that member member functions in derived class by their virtual function in which i can get the member function of base class and can do individual operation in each derived class.. what will be the syntax code for this problem how i can do these things? please reply my soon because this is my last day of assignment.. please
|
|
|
|
|
|
Sir i have mail you.. please check and teach me how i can use member member function of base class in virtual function of derived class for individual operations
|
|
|
|
|
|
That can add file header comment and function comment automatically.
|
|
|
|
|
The better way you can record one and edit that macro on your choice simple..
Jibesh V P
|
|
|
|
|
You will get a EN_KILLFOCUS message,when the focus switch from CIPAddressCtrl to another control, and this is normal case. But when you click at the dots among four ip fields,
you will get the EN_KILLFOCUS message too(with SPY++), which is not what I want, because I just want to do data validation when
the CIPAddressCtrl lost focus. How can I filer the EN_KILLFOCUS message when I click the dots???
|
|
|
|