|
CMemFile is the CFile-derived class But supports memory files .
if you want particular content, press "CMemFile" in the index cote of MSDN.
the article is detailed in msdn.
dupengfei
|
|
|
|
|
I find that file can be created,
but how API methods can access it?
|
|
|
|
|
CMemFile fMem;
LPBYTE lpByte = fMem.Detach();
after create the memory file , you can use this function "Detch" to get
the pointer to file. then operator it with pointer freely.
dupengfei
|
|
|
|
|
Also, make sure you are aware of the legal patenting laws that surround Lempel Ziv Welch (LZW) compression technique used in GIF, which supposedly expired on June 19 2003, whether they have renewed it I'm not sure, but just a thought if your doing this for a company or something . Check this link out for further info http://msdn.microsoft.com/msdnmag/issues/02/03/c/
Alan.
|
|
|
|
|
If you check out CxImage Library here on this site there
http://www.codeproject.com/bitmap/cximage.asp
There is an example of this in the demo. Like Dangleberry said, outside the US, GIF is subject to patents until the middle of 2004.
|
|
|
|
|
I have control like ATLButton(MSDN) , based
on IPictureDisp* property- to make picture incorporated into
resource,
and if I simply insert such a control into a dialog and
set picture to that property - after closing dialog there is
MEMORY LEAK.
But if I create control by hand as
code:--------------------------------------------------------------------------------
create:
//------------------------------
if(m_pAtlButton ==0)
m_pAtlButton = new CAtlbutton1;
m_pAtlButton->Create("","",WS_VISIBLE | WS_CHILD, CRect(100,100,200,200),this,IDC_ATLBUTTON1);
CDataExchange dx(this,0);
CComPtr<ipicturedisp> p;
USES_CONVERSION;
OleLoadPicturePath( A2W("E:\\CODE\\River 1.1\\Pictures\\recuperator_alarm.jpg"),
0,0,0,
IID_IPictureDisp, (void**)&p);
DDX_Control(&dx, IDC_ATLBUTTON1, *m_pAtlButton);
m_pAtlButton->putref_PictureStatic(p); //call by CDialog
//Or so: //m_pAtlButton->put_PictureStatic(p);
//-------------------
delete
if(m_pAtlButton )
{
m_pAtlButton->DestroyWindow();
m_pAtlButton->InternalRelease();
delete m_pAtlButton;//->DestroyWindow();
m_pAtlButton =0;
this->Invalidate();
this->UpdateWindow();
}
//------------------------------
at control
[propputref, id(8)]
HRESULT PictureSecond([in]IPictureDisp* pPicture);
[propput, id(8)]
HRESULT PictureSecond([in]IPictureDisp* pPicture);
[propget, id(8)]
HRESULT PictureSecond([out, retval]IPictureDisp** ppPicture);
--------------------------------------------------------------------------------
and than delete it - all works correctly. No memory leaks.
What I must do that usual CDialog not cause
memory leak?
And where it happen?
Thanks you.
|
|
|
|
|
Hi All!
I have picture in qcif format (176x144)
i have it's luminance values and chrominance also. (YUV 4:2 )
Now question
does anybody know how to conwert those YUV values to RGB?
assuming i have such structure:
<br />
typedef struct qcif<br />
{<br />
char Y[144][176];<br />
char U[72][88];<br />
char V[72][88];
}<br />
please help me, i was searching on google but without any success
Take care
Pawel Olszewski
P.S.
i have found RGB->4:2:2 and RGB-->4:2 converter:
rgb_422 & rgb_420
|
|
|
|
|
there is a tool to grap webcam pictures. name is vgrabbj for linux.
you must search for it in google. then download the source code.
in the source code is a file ccvt_c.c. this file has functions to convert YUV<-->RGB. it is c code .
good luck !!
|
|
|
|
|
Thank You selfk!
It was really clear code, i haven't even 1 warning etc.
Thanks once again
|
|
|
|
|
Hi guys,
I am trying to get status of my remote network equipment, through snmp.
I am trying to convert the oid to AsnObject Identifier using the following call.
if (!SnmpMgrStrToOid(Oid, &reqObject))
AfxMessageBox("SnmpMgrStrToOid failure");
The oid I am passing is char Oid[255]=".1.3.6.1.2.1.2.2.1.8";
I added '.' at the end for a second trail, still I am always getting failure. What wrong with my code ??
Thanks in advance,
Satya
|
|
|
|
|
Hi there,
I have a number of .ico files, each having an icon in it. I want to build a toolbar containing buttons, each having an icon from one of these .ico files.
Kindly tell me how to do this.
Regards
Gaurav Gumber
|
|
|
|
|
I would do it the following way:
1) Load the icon using the LoadIcon API function.
2) Use the GetIconInfo API function to get a ICONINFO structure which contains a HBITMAP handle to the color bitmap.
3) Set the toolbar-button's bitmap using the MFC CToolBar::SetBitmap function.
Hope that helps
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
I have used some of the ideas from Nishant S's article "Some handy dialog box tricks, tips and workarounds" sections "How to steal focus on 2K/XP" and "Making your dialog stay on top"
What: I want a dialog to be shown for a number of seconds, "stealing" mouse input (using ClipCursor) and thereafter releasing. This is working now, but my problem is that the previous foreground window is not activated by windows (Using W2K).
A solution could be to save the current foreground pointer and after releasing the mouse, then use the pointer
m_pPrevious->SetForegroundWindow();
This works (most of the time) but the help for GetForegroundWindow() warns that it is a temp pointer. And in speciel cases that has shown to be true.
How do I ensure re-activation of the previous "foreground window"??
|
|
|
|
|
As far as I can see, this warning is only mentioned in the MFC CWnd::GetForegroundWindow function... so why not use the Win32 API function GetForegroundWindow directly?
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Thanks
This is worth a look...
I called GetForegroundWindow in my dialog class and didn't know of the other .(
I guess I could use ::IsWindow() to check if this handle still is valid
|
|
|
|
|
I'm not used to create my own libraries in C++ (Did it dozens of times in java), but now I want to create one implementing easy to use logging functions.
MyLog.lib is a win32 static library. It works fine when linked from an ordinary win32 console application.
But, when trying to implement it in an MFC application, I get numerous linking errors.
Did I forget something? Is it possible to link to a win32 library from an MFC app?
tnx
using: [VISUAL STUDIO 6.0 sp5] [WIN98/2]
|
|
|
|
|
Zizilamoroso wrote:
I get numerous linking errors.
Which? What is the linker complaining about?
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Linking...
LIBCD.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCD.lib(crt0dat.obj) : error LNK2005: __exit already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in msvcrtd.lib(cinitexe.obj)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in msvcrtd.lib(cinitexe.obj)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in msvcrtd.lib(cinitexe.obj)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in msvcrtd.lib(cinitexe.obj)
LIBCD.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in msvcrtd.lib(MSVCRTD.dll)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: __setmbcp already defined in LIBCD.lib(mbctype.obj)
LINK : warning LNK4098: defaultlib "msvcrtd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "LIBCD" conflicts with use of other libs; use /NODEFAULTLIB:library
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Test.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
using: [VISUAL STUDIO 6.0 sp5] [WIN98/2]
|
|
|
|
|
You seem mix up the runtime libraries. Please check your project settings: You need to have *ALL* projects set to using either "multithreaded" *OR* "multithreaded dll".
Maybe you need to make both versions of your library for use in different projects.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
They're both "debug multithreadeded", but the mfc app was "debug multithreaded dll". The " dll" piece of the string fell out of the combobox' window bounds )) So, that's why I didn't saw this one.
I demand larger comboboxes in VC!!! ) lol
tnx jhwurmbach
using: [VISUAL STUDIO 6.0 sp5] [WIN98/2]
|
|
|
|
|
Now it works?
Great!
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
hello friends
Can any one tell me
How to create Common Browse Dialog box for folder selection which contains TreeCtrl with check boxs in it.
Thanx
TAKE CARE
|
|
|
|
|
Simple! Just look at the articles already on the site here.
For example, take the article "Browse For Folder" dialog alike with source[^] and adapt
it by adding the checkbox style to the tree, and adding accessor methods for the check data.
Should only take you 30 seconds...
Other articles may give you inspiration.
Iain.
|
|
|
|
|
i have 2 projects in the same workspace, namely SDI database and another SDI based dialog, i wish to link up the database to my dialog, how to do this?
|
|
|
|
|
Hi all, back with a slightly different issue. OK, here's what I'm trying to do:
I'm writing a template container class for a dynamic array (similar to the vector class). The class will be used as a basis for my own custom string allocation and more complex class structures. With this in mind, operator new in its standard form has not been implemented because it cannot be used to expand memory, I would, in effect, have to new another block of memory and copy the contents over before deleting the old block, this is slow and prone to mistakes. Therefore malloc has been implemented, with realloc, to handle the actual memory allocations. However, the problem with malloc is that it never calls the constructor for the object you want to store, it just allocates raw bytes. BUT, does this mean I could use placement new to initialise a block of memory with type T as follows:
<br />
T* p = malloc(sizeof(T));<br />
if(p)<br />
{<br />
new (p) T;<br />
}<br />
I would like to be able to call the constructor for each object in the malloc'ated area but similarly I can't use new cos I want it to be fast AND dynamic. Any good links, ideas, suggestions on how I'm going about this would be very much appreciated. This class will be a foundation for many things and I need it to be neat, at the moment it works, but its buggy cos things aren't getting constructed properly. Thanks guys.
|
|
|
|