|
Anjali Patil wrote: i want to divide status bar control panes into 3 equal parts,how can i do this?
CStatusBar documentation has got some secret API's hidden in it. If just you could have read the documentation
Look here[^] for a sample
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Hi all
What does this error mean:
1>nafxcwd.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in UpdatePanel.obj
1>nafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in LIBCMTD.lib(new.obj)
1>nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in LIBCMTD.lib(dbgdel.obj)
1>nafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z) already defined in libcpmtd.lib(newaop.obj)
1>nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z) already defined in LIBCMTD.lib(delete2.obj)
This happens here:
#include <afxdb.h>
#include <winsock2.h>
#include <tchar.h>
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>
#endif // _AFX_NO_AFXCMN_SUPPORT
#include "..\\Common\\smtpconnection2.h"
BOOL CSMTPConnection2::Connect(LPCTSTR lpszHostDomain,
DWORD dwTimeout ) throw()
{
CSimpleArray<CAtlString> arrSMTP;
_GetSMTPList(lpszHostDomain, arrSMTP);
for(int i=0; i<arrSMTP.GetSize(); i++)
{
if(CSMTPConnection::Connect(arrSMTP[i], dwTimeout) == TRUE)
return TRUE;
}
return FALSE;
}
void CSMTPConnection2::_GetSMTPList(LPCTSTR lpszHostDomain,
CSimpleArray<CAtlString>& arrSMTP)
{
PDNS_RECORD pRec = NULL;
if(DnsQuery(lpszHostDomain, DNS_TYPE_MX, DNS_QUERY_STANDARD,
NULL, &pRec, NULL) == ERROR_SUCCESS)
{
PDNS_RECORD pRecOrig = pRec;
while(pRec)
{
if(pRec->wType == DNS_TYPE_MX)
arrSMTP.Add(pRec->Data.MX.pNameExchange);
pRec = pRec->pNext;
}
DnsRecordListFree(pRecOrig,DnsFreeRecordList);
}
}
What do you think?
Thanks,
Jayjay
|
|
|
|
|
See here[^]
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Hi there
I am trying to establish an Internet session (HTTP GET) with a MFC
application on a Windows Mobile 6 platform. First I tried with
OpenRequest() and SendRequest(), but when the code reached SendRequest
() the application crashed in the evil way. Secondily I tried to use
OpenURL() but it keeps saying that it cannot find the server. I have
even connected the device to my WLAN to ensure I had a stable Internet
connection.
CString GoogleMap::getMapUrl(int width, int height, double lng, double
lat, int zoom, CString format)
{
char * szUrl = (char*)malloc(256);
char * szFormat = "http://maps.google.com/staticmap?center=%f,%f&format=%s&zoom=%d&size=%dx%d&key=%s";
sprintf(szUrl, szFormat, lat, lng, format, zoom, width, height,m_szAPIKey);
CString s = CString(szUrl);
return s;
}
BYTE* GoogleMap::loadHttpFile(CString url, long &length)
{
BYTE* buffer = NULL;
CInternetSession session;
CHttpConnection * hc = NULL;
hc = session.GetHttpConnection(_T("maps.google.com"), 0, 80, NULL,NULL);
if (!hc) return NULL;
CHttpFile* pFile = (CHttpFile*)session.OpenURL(url);
length = (long)pFile->GetLength();
if (!length) return NULL;
buffer = (BYTE*)malloc(length + 1);
memset(buffer, 0, length +1);
for ( DWORD dwRead1;dwRead1=pFile->Read(buffer,length); );
return buffer;
}
Could someone please tell me what I do wrong?
Thanks in advance,
Jess
--
Jess Nielsen, b.sc.
Security Analyst
http://jessn.blogspot.com/
|
|
|
|
|
Hi, I asked a question sort of similar to this a few days ago, but the problem has now evolved; what I want to do is:
I am using C++ with the windows API, without MFC.
I want to retain all the functionality of a listbox but I want to draw everything myself. If I set the style to OWNERDRAW I can at least draw the listbox items and the box itself (if I don't give it border) but I still can't draw any scrollbars created using WS_VSCROLL or WS_HSCROLL; they seem to use the default windows drawing behavior.
So how do I completely override all the default drawing for a listbox (or any windows control for that matter)? I don't want to draw over the default scrollbars; I want them to simply not draw at all, but still "exist" and allow me to ownerdraw them.
Thanks!
KR
|
|
|
|
|
Did you see this[^]article?
Greg Ellis wrote:
Next, I had to find a way to customize the existing scrollbars or else make my own. So, I tried to subclass the CScrollbar class; whenever I tried to use the GetScollbarCtrl() function from the CListCtrl, it returned null. Obviously, the scrollbars are not real. Unfortunately, this means I had to hide the existing scrollbars and create my own (a lot more work than just skinning the existing ones).
I began to try to hide the scrollbars of the CListCtrl and then somehow create my own. I found a solution for hiding the scrollbars in a CListCtrl on the CodeGuru message boards from Filbert Fox. This worked great, so my next task was to create my own scrollbars.
I chose to derive a class from CStatic and create the scrollbar from scratch using bitmaps. It took a while and a lot of tweaking, but I got the custom scrollbar created and working including the wheel mouse, arrow keys, and pageup/pagedown keys.
|
|
|
|
|
Ugh, I can't believe there's no way to custom draw the internal scrollbars of a control... it may not have an HWND associated with it, but you can click it and use it just like any other scrollbar so it must send some sort of scrollbar messages, and it's drawn somewhere, somehow, so there has to be a way to custom draw it...
Thanks for the link though, more and more it keeps looking like I will have to put in my own custom scrollbars but I wish I could just take advantage of the internal ones.
KR
|
|
|
|
|
I have the following already implemented...
A base class (Say A) with a macro definition implementing two functions. Say A1 and A2.
A class ( Say B) derived from Class A.
Member functions of B called A1 and A2.
Now I have a need for the following...
Without changing any code in the derived class B or its member functions I want to know inside A1 or A2 functions the function/line number/file from which A1 or A2 gets called.
Is this possible??
|
|
|
|
|
Correction to my question
I have the following already implemented...
A base class (Say A) with a macro definition implementing two functions. Say A1 and A2.
A class ( Say B) derived from Class A.
Member functions of B called B1 and B2.
B1 calls A1
B2 calls A2.
Now I have a need for the following...
Without changing any code in the derived class B or its member functions I want to know inside A1 function the function or line number or file from which A1 gets called.
i.e I cannot change the derived class(es). I can only change the base class.
Is this possible??
|
|
|
|
|
it's not going to be easy, but you should probably start here[^]
|
|
|
|
|
Thanks for your reply. But I dont want to use this approach. This was in my mind. I do realize that it might just not be possible otherwise.. Just wanted to throw my question out there to see if anybody has idea..
Thanks
|
|
|
|
|
as far as i know, there's nothing in C or C++ that can tie a function at runtime back to the source. to do that you need external support (like debugger PDB files or OS things like stack walkers)
|
|
|
|
|
Dear ALL
now i was makeing a small ping app. and i read alot about it and i take some codes from the internet and after some problems it worked at the end but i wished to be sure that packets which were sent are eaxctly what i set it so i used wireshark software to see each ICMP packets
i was sending 150 bytes discoverd the real one which was sent is 12 bytes !!!
i check it using windows Ping (MS Ping) it worked so fine
so i thought the problem is in my code , i tried many of ping codes in the net & almost no one send the right packet size !!!!!!!!
so what i should check?? anyone has idea about such problem??
thax all
bye
|
|
|
|
|
check your hardware setting,,, maybe some errors there,,,
|
|
|
|
|
Thx for your reply
but what hardware setting ??
nothing in the socket programming related to hardware
and i tried MS ping in the same PC and it worked so fine
thx
bye
|
|
|
|
|
Please Explain what exactly are you trying to do.
Did you analyse exactly what was shown by wireshark. Please post it so we know more info.
My guess is you icmp message was 12 byte but the whole packet encapsulated by lower layers(udp and ethernet frame) made it to look of wrong size to you but is of correct size.
the icmp reply also contain the orginal ping request which is again of different size.
Did you send 12 bytes and wireshark showed 150 byte.
or you sent 150 bytes and wireshark showed 12 bytes.
Just check what data are you giving to the socket????
|
|
|
|
|
Hi All,
As part of my VC++ 6.0 conversion to VC++ 9.0 i am facing a problem with this piece of code.
_variant_t GetTimeStamp()
{
.......
.......
return _variant_t(COleDateTime::GetCurrentTime(),VT_DATE); // This fails with VS 6.0 also if i use it in a new sample application
}
.....
.........
bool curtime = floor(GetTimeStamp());
In this piece of code i get an error
Error 89 error C2668: 'floor' : ambiguous call to overloaded function
Thank you.
|
|
|
|
|
Maybe
return _variant_t(COleVariant(COleDateTime::GetCurrentTime()));
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Calling floor on a VARIANT doesn't make sense, you need to pass a floating-point type to floor . Use one of the _variant_t conversion operators (double , float , etc.) and pass the result of that to floor
|
|
|
|
|
how can i map size of any file to 0.
please provide me the codes in c++
|
|
|
|
|
indiraagandhi wrote: how can i map size of any file to 0.
Uuh ? What do you mean ?
|
|
|
|
|
hi cedric
i am working on one module & their i want to hide the size of file from unauthorised user so he is unable to read that file for that i want some help
|
|
|
|
|
Hi,
to truncate a file, you can open it for writing, then close it.
|
|
|
|
|
What no codes?
led mike
|
|
|
|
|
led mike wrote: no codes?
No C++ codes today. Am still recovering from a little Fortran experience. All upper-case.
|
|
|
|