|
Please follow the following link for better idea
http://www.codeguru.com/forum/showthread.php?s=d09323bd39f2dd0a942e34fe1155af42&threadid=296795
My main aim is to draw the content to view such that when user wants he can save the same to image file. Thats it?
What i tried that i drawn completely into the ClientDc and at the end (see first post) i am making the memory device context and then storing teh content to the image file.
Well but it seems that MemDC is taking the complete Mainwindow instead of the required clientdc.
Help me in this regard
Thanks in advance
sandeep
Leave your mark wherever you go
|
|
|
|
|
Hi i am trying to use ole Ipicture interface to load pictures of different formats but the OleloadPicturePath method fails.
What i am doing is given below.
any help would be appreciated and a lot of thanks in advance.
void * CMap::OpenGraphics(char * name)
{
IPicture *Ipic = NULL;
SIZE metric,pixel;
const int H_METRIC_PER_INCH = 2540;
HDC hdcScreen =GetDC(NULL);
HRESULT hr;
int SxpixPerInc = GetDeviceCaps(hdcScreen,LOGPIXELSX);
int SypixPerInc = GetDeviceCaps(hdcScreen,LOGPIXELSX);
unsigned short OlePathName[512];
ReleaseDC(NULL,hdcScreen);
mbstowcs(OlePathName,name,23);
char s[10];
MessageBox(NULL,itoa(int(OlePathName),s,10),"OLE",MB_OK);
hr = OleLoadPicturePath(OlePathName,NULL,0,0,IID_IPicture,(void **)(Ipic));
if(hr)
{
MessageBox(NULL,"ERROR WHILE LOADING PIC PATH","",MB_OK);
return 0;
}
if(Ipic)
{
Ipic->get_Height(&metric.cy);
Ipic->get_Width(&metric.cx);
pixel.cx = (SxpixPerInc*metric.cx + H_METRIC_PER_INCH/2)/H_METRIC_PER_INCH;
pixel.cy = (SypixPerInc*metric.cy + H_METRIC_PER_INCH/2)/H_METRIC_PER_INCH;
ImageInfo.Ipic = Ipic;
ImageInfo.pixel = pixel;
ImageInfo.metric=metric;
ImageInfo.path = name;
return Ipic;
}
return 0;
}
|
|
|
|
|
Hi there,
You are missing an & in front of Ipic.
hr = OleLoadPicturePath(OlePathName,NULL,0,0,IID_IPicture,(void **)(<big>&</big>Ipic));
Fabian
|
|
|
|
|
Hello everyone.
I want to attach a dialog to display as a view. How to do it?
Please help me.
Thank you.
-Freehawk
|
|
|
|
|
do you mean of FormView
Leave your mark wherever you go
|
|
|
|
|
Just use CFormView class.
|
|
|
|
|
Dear Friends,
Suppose i got an ActiveX control (or any COM dll). I am distributing it will by application. Now the problem is that anyone can utilize that dll or OCX. I want to prevent others to use my OCX and dlls. How can i ensure the security of my COM controls so that no one else can use it.
Imtiaz
|
|
|
|
|
HI One Idea is...
Create Time:
in OCX or DLL define a variable with some value let XXXX
& check at load time. if false then exit.
On Use time:
at contructor or on_load set that value as XXXX(as u set that in coding u know that..) & then start application....
OK! Bye
---Sumit Kapoor--- sumit_kapoor1980@hotmail.com
|
|
|
|
|
MapViewOfFile() if giving me an address that is out of process address range. Trying to use it gives me an access violation as expected. All parameters passed in to MapViewOfFile seems to be fine. Anyone has faced the same problem before ?
Thanks
|
|
|
|
|
(From MSDN)
Reading from or writing to a file view can cause an exception. For example, accessing a mapped file that resides on a remote server can generate an exception if the connection to the server is lost. Exceptions can also occur because of a full disk, because the file is shared and a different process has locked a byte range, or because of an underlying device failure or memory allocation failure. To guard against exceptions due to input and output (I/O) errors, all attempts to access memory mapped files should be wrapped in structured exception handlers.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Check the last parameter to CreateFileMapping as I think this needs to be a wide character string otherwise you get a GPF then or later.
Roger Allen - Sonork 100.10016
Strong Sad: I am sad I am flying
Who is your favorite Strong?
|
|
|
|
|
Now I want set the Paragraph JUSTIFY alignment of text like Microsoft word.Paragraphs are justified at the two sides of the text;
I do this by follow,but it is of no effect,I don't know
what it's the reason.Can you help me?
_AFX_RICHEDITEX_STATE _afxRichEditStateEx ;
_AFX_RICHEDITEX_STATE::_AFX_RICHEDITEX_STATE()
{
m_hInstRichEdit20 = NULL ;
}
_AFX_RICHEDITEX_STATE::~_AFX_RICHEDITEX_STATE()
{
if( m_hInstRichEdit20 != NULL )
{
::FreeLibrary( m_hInstRichEdit20 ) ;
}
}
//AfxInitRichEditEx by called in the InitInstance() function of the App.
BOOL PASCAL AfxInitRichEditEx()
{
if( ! ::AfxInitRichEdit() )
{
return FALSE ;
}
_AFX_RICHEDITEX_STATE* l_pState = &_afxRichEditStateEx ;
if( l_pState->m_hInstRichEdit20 == NULL )
{
l_pState->m_hInstRichEdit20 = LoadLibraryA( "RICHED20.DLL" ) ;
}
return l_pState->m_hInstRichEdit20 != NULL ;
}
void CAutoRichEditCtrl::SetParagraphJustify()
{
PARAFORMAT2 pf;
pf.cbSize = sizeof(PARAFORMAT2);
pf.dwMask = PFM_ALIGNMENT;
pf.wAlignment = PFA_JUSTIFY;
SetParaFormat(pf);
}
|
|
|
|
|
Hi
I have one quick question here: is it possible to insert a class with private copy constructor and assignment operator into a Visual C++ vector STL? How about other STL implementations? I have tried it on VC++ 6.0, and it does not seem to be possible. Or maybe there's another not-so-straightforward way to do it?
Thanks!
|
|
|
|
|
You can't use such objects with any standard-conforming implementation of the STL. STL containers require that the elements stored in them are copyable by a copy constructor and assignable by the assignment operator.
|
|
|
|
|
No, not by value. In fact, by making the copy constructor and assignment operator private, you are declaring that you cannot copy objects of this type, hence there is no container which can store them by value. You need to store pointers to them.
--
Booohoo!
|
|
|
|
|
Hi , this is my problem if anybody knows that plz give me a use full tips,
Probs:- I have a DLL it contain only resource , I would like to replace one particular string, that is in side resource DLL. But I don’t want to recompile it.
~ Rahuraman.K
|
|
|
|
|
Hope this[^] helps
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
|
To edit resource-containing exe/dll-files, you just need a tool called "Res[ource]Hacker"...
|
|
|
|
|
|
Thanks for u'r immediate response with plenty of information
~Rahuraman.K
|
|
|
|
|
How can i display my own tooltips using VC. I am talking about the ones such as function declarations that VC displays in the IDE.
Any help will be appreciated
Vikash Parida
|
|
|
|
|
Sorry, I haven't my source code on this computer at the moment
But you can create Tooltips with the "CreateWindowEx" function, then you
need to specify something like WC_TOOLTIP or perhaps "TOOLTIP32" as window class -- take a look at the Win32.hlp - it is being described there
|
|
|
|
|
Hi,
It would be great if somebody can help me with this doubt.
My main target is :In order to list the patches and their dependancies on the target machine(for ex:my machine):
Should I have to go through the path -
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
or
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\
When I went through this path.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
I am able to get a list of hot fixes .
What are hot fixes and are these patched?
When I went through this path.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\
I am able to see 3 entries-
Data Access
Windows 2000
Windows MEDIA pLAYER
And under Windows 2000 -I am seeing 2 entries SP4 and SP5.
Is SP4 is the list of service packs?
Is SP5 is the list of updates?
SP5 has a folder called FileList.
This folder when I click shows some dlls on the right pane.
Are these dependancies?I mean dependancies which these patches depend?
Pls guide.
|
|
|
|
|
Hi,
It would be great if somebody can help me with this doubt.
My main target is :In order to list the patches and their dependancies on the target machine(for ex:my machine):
Should I have to go through the path -
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
or
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\
When I went through this path.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
I am able to get a list of hot fixes .
What are hot fixes and are these patched?
When I went through this path.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\
I am able to see 3 entries-
Data Access
Windows 2000
Windows MEDIA pLAYER
And under Windows 2000 -I am seeing 2 entries SP4 and SP5.
Is SP4 is the list of service packs?
Is SP5 is the list of updates?
SP5 has a folder called FileList.
This folder when I click shows some dlls on the right pane.
Are these dependancies?I mean dependancies which these patches depend?
Pls guide.
|
|
|
|