|
I've this class
class CImageBase : public CImagePan
{
public:
CImageBase();
virtual ~CImageBase();
virtual BOOL Decode(char *pcMemBuff, long lFileLength) PUREVIRTUAL;
// Implementation of pure virtual functions in CImagePan class
virtual int GetEffWidth() const { return EffWidth; };
virtual int GetWidth( void ) const { return Width; };
virtual int GetHeight( void ) const { return Height; };
virtual int GetDepth( void ) const { return Depth; };
virtual int GetColorType( void ) const { return ColorType; };
virtual BOOL Inside(int x, int y) const { return (0<=y && y<height &&="" 0<="x" x<width);="" }
="" virtual="" int="" getindex(int="" x,="" y);
="" bool="" setindex(int="" y,="" index);
="" getrgb(int="" byte*="" r,="" g,="" b);
="" setrgb(int="" byte="" imagepointertype="" getrawimage()="" {="" return="" rawimage;="" getrawimagesize()=""
="" {
="" (lpbi-="">biSize + lpbi->biSizeImage);
}
virtual LPBITMAPINFOHEADER GetBitmapInfoHeader() { return lpbi; }
virtual void BGR2RGB(unsigned char* pBuffer,int iCount);
protected:
ImagePointerType RawImage; // Image data
void AllocateImage();
int Width, Height; // Dimensions
int Depth; // (bits x pixel)
int ColorType; // Bit 1 = Palette used
// Bit 2 = Color used
// Bit 3 = Alpha used
int RawImageSize;
long EffWidth; // Effective Width
LPBITMAPINFOHEADER lpbi;
int bgindex;
friend class CImageIterator;
};
How can i transform a Cimage object in a Bitmap^ bmp ?
Thanks, regards
|
|
|
|
|
Do you need to a handle of CImage class?
|
|
|
|
|
I've another ref class where i declare in a method{
func()
{
....
CImage jpgframe;
jpgframe.CreateImage(bufferjpg,mycam->jpg->len,1);
jpgframe.Decode(bufferjpg,mycam->jpg->len);
...
}
and i want to use jpgframe to create a Bitmap^ bmp but i dont't know how.
Can you help me?
Thank a lot, regards.
|
|
|
|
|
Hi All
I want to use tooltip on toolbar in other than default font. So how can i create customize tooltip so that font of tooltip can change.
Thanks and Regards
Atul
|
|
|
|
|
|
See Here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hi all,
Can anyone suggest how to place a dialog in an other dialog just llike placing some control in a dialog.
Thanks
|
|
|
|
|
|
LRESULT DlgProc( HWND hWnd , UINT message , WPARAM wParam , LPARAM lParam )
{
switch( message )
{
case WM_COMMAND :
//process commnads here
break ;
case WM_CLOSE :
::PostQuitMessage(0);
break ;
}
return ::DefWindowProc(hWnd , message , wParam , lParam ) ;
}
void CchiDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
HWND hWnd =::CreateDialog( 0 , MAKEINTRESOURCE(IDD_ABOUTBOX), this->GetSafeHwnd() , (DLGPROC)DlgProc) ;
MSG msg ;
while( ! GetMessage( &msg , 0 , 0 , 0 ) )
{
::TranslateMessage( &msg ) ;
::DispatchMessage( &msg ) ;
};
::ShowWindow( hWnd , SW_SHOW ) ;
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
//i dont know u r trying on win32 or mfc.
//best wishes
|
|
|
|
|
|
//add WS_CHILD style to your child form
//eithor in dialog propery (style) or by using
//SetWindowLong( hWnd , GWL_STYLE , GetWindowLong( hWnd , GWL_STYLE ) | WS_CHILD ) ;
//the dialog must be called modlessly
|
|
|
|
|
Hello,
I am creating an application in non- Doc -View architecture where I want to create the mainframe window using Create. In the parameters I don't understand what will be the parent of the mainframe window and where is the option to provide CMenu object for the menu that I want to attach to the Mainframe window.I do not want to use menu resource for the mainframe.
And if I don't use the Loadframe() of the FrameWnd then how do I provide other resources to the mainframe window.
Prithaa
|
|
|
|
|
prithaa wrote: In the parameters I don't understand what will be the parent of the mainframe window and where is the option to provide CMenu object for the menu that I want to attach to the Mainframe window.I do not want to use menu resource for the mainframe.
Here is a code snippet that does this...
class MyFrame : public CFrameWnd
{
public:
MyFrame()
{}
BOOL Create()
{
LPCTSTR lpctszClass = AfxRegisterWndClass( CS_HREDRAW | CS_VREDRAW,
LoadCursor( 0, IDC_ARROW ),
GetSysColorBrush( 1 ));
m_Menu.CreateMenu();
m_Menu.InsertMenu( 0, MF_BYPOSITION | MF_STRING, 1, _T( "Nibu" ));
CFrameWnd::Create( lpctszClass, _T( "Nibu's frame" ), WS_OVERLAPPEDWINDOW, rectDefault, 0, 0, 0, 0 );
SetMenu( &m_Menu );
return TRUE;
}
CMenu m_Menu;
};
You might have to modify this to your liking, but the idea is there.
|
|
|
|
|
Hello,
Thanks I will try that.
Prithaa
|
|
|
|
|
prithaa wrote: Thanks I will try that.
Look up CFrameWnd::LoadFrame to see how they are doing it. You might get some more help.
Carry on.
|
|
|
|
|
Hello,
I tried it.
But still te compiler refuses to create the frameWnd and the error arises where the compiler wants the menu through
::SetMenu(m_hWnd, pMenu->GetSafeHmenu());
and the menu is not provided.
And in your code snippet the SetMenu is called after the window is created then what will be the default menu
Prithaa
|
|
|
|
|
prithaa wrote: I tried it.
But still te compiler refuses to create the frameWnd and the error arises where the compiler wants the menu through
::SetMenu(m_hWnd, pMenu->GetSafeHmenu());
and the menu is not provided.
And in your code snippet the SetMenu is called after the window is created then what will be the default menu
Show me your code. Just pass in a NULL for menu. Later on set it.
|
|
|
|
|
Hello,
thanks Sir
But where should I pass the NULL for menu since I see
no parameter for menu before creating the frame window.
We AfxRegisterWindow() without menu parameter and Create() without menu parameter.
Here is the code snippet.
CMDIFrameWnd* pFrame = new CMainFrame;
m_pMainWnd = pFrame;
CMenu m_Menu;
LPCTSTR lpctszClass = AfxRegisterWndClass(
CS_HREDRAW |CS_VREDRAW,
LoadCursor(IDC_ARROW),
GetSysColorBrush( 1 ));
m_Menu.CreateMenu();
m_Menu.InsertMenu( 0, MF_BYPOSITION | MF_STRING, 1,
_T( "Demand" ));
pFrame->Create( lpctszClass, _T( "Demand Frame" ),
WS_OVERLAPPEDWINDOW,
CRect(0,0,0,0), 0, 0, 0, 0 );
pFrame->SetMenu( &m_Menu );
return TRUE;
Pritha.
|
|
|
|
|
How can i close file handles used by another processes ?
|
|
|
|
|
Can you more example what applications?
|
|
|
|
|
nitinmx wrote: How can i close file handles used by another processes ?
I'm not sure why you’d want to but as far as I know they answer is no, or at least not easily. The only way I can think of to achieve this is to get the owning process to close the HANDLE for you via code injection: by using SetWindowsHookEx for example. Again, doing this is dubious to say the least.
Steve
|
|
|
|
|
Hi,
I'm working under VS 6 C++ and need to parse date from YYYY-MM-DD HH:MM:SS to any of SYSTEMTIME or tm structures. I'm struggling to use CTime, because it requires to run under MFC(does it? ) and I'm creating a COM object. Or is there a way to use CTime while creating COM ?
PS : I'm not having problems with parsing "YYYY-MM-DD HH:MM-SS" formated string into Int values and filling them into e.c. SYSTEMTIME structure, but I don't know how to compare two dates created that way. When I try to create FILETIME from SYSTEMTIME (to be able to compere them) using SystemTimeToFileTime(...) method, it doesn't work corretly. I suppose it's beacuse of the source SYSTEMTIME doesn't have all fields set (Day of Week and MILISECONDS - which are for me irrelevant, I can set miliseconds to zero but I don't know how to determine day of week)
thanx for any ideas
|
|
|
|
|
I dont know exactly what your problem is, but maybe this will help
SYSTEMTIME ST;
GetLocalTime(&ST);
CString TimeStamp;
TimeStamp.Format("%ld-%ld-%ld%ld:%ld",ST.wYear,ST.wMonth,ST.wDay,ST.wHour,ST.wMinute);
Note that you might have to make a simple function which adds a 0 infront of some of the variables for it to look nicer
//Johannes
|
|
|
|
|
You can use CRT function mktime() to make a time_t, and then you can do everything you want. Take a look at CTime's source. (c:\Program Files\Microsoft Visual Studio\VC98\MFC\SRC\TIMECORE.CPP )
|
|
|
|
|
Zilo(svk) wrote: I'm struggling to use CTime, because it requires to run under MFC(does it? )
You can also use ...
_tcsftime
|
|
|
|
|