|
CDC* pDC = pView->GetDC();
int nSaveDC = pDC->SaveDC();
CDC MemDC;
MemDC.CreateCompatibleDC(pDC);
CBitmap bitmap;
bitmap.CreateCompatibleBitmap(pDC, GetTotalCx(), GetTotalCy());
CBitmap* pOldBitmap = (CBitmap*)MemDC.SelectObject(&bitmap);
pDC->BitBlt(0, 0, GetTotalCx(), GetTotalCy(), &MemDC, 0, 0, SRCCOPY);
CBitmap* pFinalBitmap = (CBitmap*)MemDC.SelectObject(pOldBitmap);
CImage Image;
Image.Attach((HBITMAP)pFinalBitmap->m_hObject);
Image.Save(lpszPathName, Gdiplus::ImageFormatBMP);
Image.Detach();
pDC->RestoreDC(nSaveDC);
bitmap.DeleteObject();
Here is the new code ... but strange, CImage::Save return 0... it is OK ? The saved image looks good ...
|
|
|
|
|
CImage::Save returns a HRESULT where zero indicates success.
|
|
|
|
|
Ahh, yes, you are right. Thank you.
|
|
|
|
|
I want to drag and drop a file on treeview to a listbox.But i only drag item only on treeview but i can't drag outside treeview control.
Can't you help me ?
Many thanks
|
|
|
|
|
|
Linking executable ggpofba-ng.exe...
main.o : error LNK2001: símbolos externos indefinidos "void __cdecl QuarkInit(wchar_t *)" (?QuarkInit@@YAXPA_W@Z)
ggpofba-ng.exe : fatal error LNK1120: 1 externo não resolvidos
makefile.vc:313: recipe for target 'ggpofba-ng.exe' failed
mingw32-make[2]: *** [ggpofba-ng.exe] Error 1120
this error is happening at the end of compilation I already posted something about it helped me include everything right in .he cpp
I discovered that for this error does not appear I have to change in cpp put TCHAR more if I do more error appears in the .cpp then he is char how do I corrigiri so I will let the three files containing this function I grasped C ++ now vlw
|
|
|
|
|
part of the main.cpp
else if (_tcsncmp(szName, _T("quark:"), 6) == 0) {
QuarkInit(szName);
|
|
|
|
|
part of the .h
// fba_quark.cpp
bool QuarkInit(CHAR *connect);
bool QuarkNetworkGame();
bool QuarkDumpSprites();
|
|
|
|
|
Reset your application properties to use ASCII rather than Unicode, or find a matching Unicode library for the Quark functions.
|
|
|
|
|
Go to Parentwhen they procure step QuarkInit ( TCHAR * connect) he did not correct me back the main error plus it returns these errors in my function and do not know how to fix
excuse the English BR
error C2664: 'int printf(const char *,...)': não é possível converter um argumento 1 de 'TCHAR *' em 'const char *'
Tipos apontados não são relacionados; conversão requer reinterpret_cast, conversão C-style ou conversão function-style
if I send to you the code is how you correct for me the code and an online game emulator
|
|
|
|
|
robsons2007 wrote: if I send to you the code No, my support is confined to answering questions here. The problem is that you are mixing ASCII and non-ASCII constants and variables within your code, and confusing both the compiler and the linker. Take a look at What are TCHAR, WCHAR, LPSTR, LPWSTR, LPCTSTR (etc.)?[^].
|
|
|
|
|
It is not a compiler error but a linker error telling you that the function QuarkInit() called from within the file main has not been found in any of your compiled files or libraries.
It it is contained in a library, you must add that library to your project. If it is located in some of your source files, check for correct spelling and parameter types and that the file is included in your project.
TCHAR and the _T() macro are extension used originally by the Microsoft compiler (Visual Studio). With mingw, you must include tchar.h and use an additional linker option when building an Unicode application (see http://sourceforge.net/p/mingw-w64/wiki2/Unicode%20apps/[^]).
|
|
|
|
|
when they procure step QuarkInit ( TCHAR * connect) he did not correct me back the main error plus it returns these errors in my function and do not know how to fix
excuse the English BR
error C2664: 'int printf(const char *,...)': não é possível converter um argumento 1 de 'TCHAR *' em 'const char *'
Tipos apontados não são relacionados; conversão requer reinterpret_cast, conversão C-style ou conversão function-style
|
|
|
|
|
where this error
if ( printf(connect, "quark:served", strlen("quark:served")) == 0) {
int port;
char game[256], match[256];
|
|
|
|
|
i wanna make a program in c language in which i have to ping server but i don't know how to start which header files i need....please someone help me .And this program should run on linux
|
|
|
|
|
You probably want to start Here[^]
Normally, when one says ping, that means sending icmp-echo packets and listening for icmp-reply, which requires root privileges, so keep that in mind when developing your solution.
Good luck.
|
|
|
|
|
You may find many examples of ping C source code just Googling for.
|
|
|
|
|
he probably not want to code the ping itself, but how to call it .
I'd rather be phishing!
|
|
|
|
|
struct node{
int key;
node* head;
}
node *head = NULL;
void func(node* &h,int n, int m)
{
if(n > m)
return;
else {
int mid = (n+m)/2;
func(h->head,n,mid-1);
func(h->head,mid+1,m);
}
}
I am wonder what is the difference of parameter:
func(node* &h, int n, int m)
and
func(node* h,int n, int m)
what is the usefulness of node *&h.
|
|
|
|
|
econy wrote: what is the usefulness of node *&h. It is a pointer to a reference. You can modify the pointer itself rather than the object that the pointer is pointing to.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
DavidCrow wrote: It is a pointer to a reference.
Please forgive me if I'm wrong, but isn't it a reference to a pointer, instead?
The difficult we do right away...
...the impossible takes slightly longer.
modified 23-Sep-15 18:40pm.
|
|
|
|
|
Possibly. I've actually never used either (if both are valid concepts) so I could be wrong.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Pointer to reference is not valid, since a reference is not an object.
|
|
|
|
|
func(node* &h, int n, int m)
h is a INOUT parameter, if func changes h then the caller see the changed value (that is after function execution, h could point to another address).
func(node* h,int n, int m)
h is a IN parameter, if func changes it, the caller doesn't see the changed value.
|
|
|
|
|
help at the time of compiling this error appears at the end
by compiling visual studio 2013 through the makefile.vc
<pre lang="vb">fba_ggpo.o : error LNK2001: símbolos externos indefinidos "bool __cdecl VidSSetQuarkConnectStatus(wchar_t const *)" (?VidSSetQuarkConnectStatus@@YA_NPB_W@Z)
fba_ggpo.o : error LNK2001: símbolos externos indefinidos "int __cdecl VidSSetQuarkShowLogo(bool)" (?VidSSetQuarkShowLogo@@YAH_N@Z)
fba_ggpo.o : error LNK2001: símbolos externos indefinidos "int nAcbVersion" (?nAcbVersion@@3HA)
</pre>
|
|
|
|