|
|
I am using the following code to create a bi-dimensional list :
typedef CList<CString, CString&> MYTYPE;<br />
CList<MYTYPE, MYTYPE&> myList;
But I get this :
Error C2582: 'operator =' function is unavailable in 'class'
What I'm doing wrong ?
Regards,
Cosmin Unguru
|
|
|
|
|
the CList 'class', dont have an overloaded = operator.
You have to implement your own operator
Hmm...
|
|
|
|
|
May I use IsClipboardFormatAvailable function to check CF_OWNERDISPLAY ?
if (IsClipboardFormatAvailable(CF_TEXT) || IsClipboardFormatAvailable(CF_OEMTEXT))
{
HANDLE hClipboardData = GetClipboardData(CF_TEXT);
// char* pchData = (char*)GlobalLock(hClipboardData);
LPTSTR pchData = (LPTSTR)GlobalLock(hClipboardData);
CString strFromClipboard = pchData;
//TextOut(hdc,10,10,strFromClipboard,strFromClipboard.GetLength());
dc->TextOut(0,0,strFromClipboard);
}
else if(IsClipboardFormatAvailable(CF_BITMAP))
{
HBITMAP hClibBmp = (HBITMAP)GetClipboardData(CF_BITMAP);
HDC hMemDC = CreateCompatibleDC(hdc);
HBITMAP hOldBmp = (HBITMAP)SelectObject(hMemDC,hClibBmp);
BITMAP bm;
GetObject(hClibBmp,sizeof(BITMAP),(LPSTR)&bm);
BitBlt(hdc,0,0,bm.bmWidth,bm.bmHeight,hMemDC,0,0,SRCCOPY);
SelectObject(hMemDC,hOldBmp);
DeleteDC(hMemDC);
ReleaseDC(dc);
}
else if (IsClipboardFormatAvailable(CF_OWNERDISPLAY))
{
HWND hClipboardOwner;
HGLOBAL hglobal;
hClipboardOwner = GetClipboardOwner()->GetSafeHwnd();
hglobal = GlobalAlloc(GMEM_MOVEABLE,sizeof(PAINTSTRUCT));
LPPAINTSTRUCT lpps;
lpps = (LPPAINTSTRUCT)GlobalLock(hglobal);
CopyMemory(lpps, &dc->m_ps, sizeof(PAINTSTRUCT));
GlobalUnlock(hglobal);
hdc = dc->Detach();
::SendMessage(hClipboardOwner,WM_PAINTCLIPBOARD, (WPARAM) m_hWnd, (LPARAM) hglobal);
dc->Attach(hdc);
}
Thanks in advance
|
|
|
|
|
Hi, I'd like to try out Visual Assist since Visual C++ 6.0's "syntax highlighing" (yeah right) sucks to put it directly. The problem is I'm running Windows 98 and Visual Assist X (the one I saw in the showcase) doesn't run on it, the Whole Tomato website also won't let me download a previous version. Does anybody still have either a Visual Assist 6 or 4.1 trial installer?
|
|
|
|
|
You can ask there product department for that
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Thanks, I'll try that
|
|
|
|
|
1) VC6 "syntax highlighting" is now over 10 years old.
2) Before VC6, highlighting may not have existed (so do not knock it).
3) I started out programming in monocrome (damn), it required that you knew what you were doing without visual clues (imagine that!).
4) I was (origanaly) amazed that a friend of mine went to work for a national communications company and there editor, for there propietary language, did not include a stytax hihlighting edidtor. They had to program in monochorm.
Unless you can write a better IDE with syntax highlitng you have no room to speak (I've written two of them).
Visual Assist is a prime example of how well they wrote the origanal, because the could easely (ralativaly) tye it in.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
can my application know if computer is connect to the internet very fast?
if yes, how?
I hope the detection is very fast, i.e. in 500 ms - slow detection is very easy.
thx
includeh10
|
|
|
|
|
|
Make A Worker thread that CHECK for internet every 100 ms, that the fastest way to detect any net connection
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Try:
IsDestinationReachable()
InetIsOffline()
InternetGetConnectedState()
InternetCheckConnection()
RasEnumConnections()
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi all
i want to send a BSTR data to a method of an interface of a com class . i recieved the BSTR from a method of another interface of the same com server ,but it generates a fatal error and terminates the program . is there any task to do before sending BSTR to the method , a conversion or something like that?
thank you .
|
|
|
|
|
What Type or Error are you getting and could you show your INTERFACE declaration.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Might be because of incorrect usage of BSTRs. Wherever possible, I'd suggest using CComBSTR or _bstr_t instead of raw BSTRs, as it is tough to keep track of them.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
thank you for your reply
HRESULT ISysR::GetP(BSTR * Blob1) .here the Blob1 is the output parameter .Inline HRESULT ICTParam::SetB(_bstr_t Blob2) and here the Blob2 is the input parameter . i want to send the Blob1 for the SetB method .but it shows the window "send error report " .
|
|
|
|
|
Where exactly does it bomb? I presume your code will be looking like this
HRESULT ISysR::GetP(BSTR *Blob1)
{
SetB(_bstr_t(*Blob1));
}
First, if Blob1 is an out parameter, it means that there would be no memory allocated (SysAllocString memory) to it, so calling any BSTR methods on Blob1 will blow up. The code calling GetP will probably be like
BSTR val;
GetP(&val);
It's GetP's job to allocate memory for the BSTR and return it back. What does you SetP method look like?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
thank you for your reply
IParam.tli file:
HRESULT ICParam::SetB ( _bstr_t Blob ) {
}
Iserv.tlh file :
HRESULT Iserv ::GetP(BSTR* Blob)
and in my code there is :
1 BSTR Blob=0;
2 hr = g_pIserv->GetP (&Blob);
3 if( FAILED( hr ) )
4 {
5 AfxMessageBox(" could not get param ");
6 }
7
8 hr = g_pIW51Param->SetB (Blob);
9 if( FAILED( hr ) )
10{
11 AfxMessageBox(" could not set blob ");
12}
at line 8 there is an error . it shows the error dialog with send error report button and don't send button .it doesn't say the error description
|
|
|
|
|
hai..
I am automating the word application. I need to retrieve the current line where the cursor is placed. And also if any bullets are present at starting of the line, i need the name of the bullet also.Please let me know.
Thanking you.
E.Veera Raghavendra.
e.veera raghavendra
|
|
|
|
|
hi
thanks for the previous help
i have got one more problem .
passing the tab ctrl b/w two files i am inserting the code for that .
but its working only in the debug mode not in the release mode .
i have checked inserting the message boxs . LeftWnd is the treeView window
And CTestPlanView is another Property Page
Event is OnKeyDown
if (nChar == 9)
{
MessageBox("tab pressed");
CSplitterFrame* pFrm = (CSplitterFrame*)GetParentFrame();
if (Item_Type=="D")
{
MessageBox("Item D is Highlighted");
if(app->m_bValue == false)
{
MessageBox("No items in the list");
CTransducerView *pListView=(CTransducerView *)pFrm->GetRightPane();
pListView->m_PropSheet.SetActivePage(0);
app->m_bTreeTabPressed = true;
pListView->SetFocus();
}
else
{
CTestPlanView *pListView = (CTestPlanView*)pFrm->GetRightPane();
pListView->SetFocus();
}
}
else
{
CView* pListView = NULL;
pListView=pFrm->GetRightPane();
app->m_bTreeTabPressed = true;
pListView->SetFocus();
}
|
|
|
|
|
Enclose your code with HTML pre and /pre tags, that will make it easier for us to read your code. Beyond that, after reformatting you code, it still makes no since.
You're getting pointers to frames and panes (both just pointers to windows), which you're not doing anything with.
Example:
{
CTransducerView *pListView=(CTransducerView *)pFrm->GetRightPane();
pListView->m_PropSheet.SetActivePage(0);
app->m_bTreeTabPressed = true;
pListView->SetFocus();
}
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
hi
GetRightPane is a function i have written to access many window handles depending on the situation. their are 2 panes right and left, both are splitted .i want to pass tab control from left pane to right pane .but its working in debug mode only not in the release mode .i tried it by doing it in PreTranslateMessage also but no use . i couldn't find the reason for this .using the frame i am getting the window handle of the propertypage i need and using pListView I am setting the focus for the page .
|
|
|
|
|
c:\program files\microsoft visual studio\vc98\include\mshtml.h(16768) : error C2367: 'IHTMLControlElement' : redefinition; different uuid specifiers
c:\program files\microsoft visual studio\vc98\include\mshtml.h(16768) : see declaration of 'IHTMLControlElement'
Hi,
Whenever I try to compile any project that uses CHtmlView I get the abover error. Any ideas how to fix this.. I took a quick look through the headers and couldn't find another definition of IHTMLControlElement? The error points to the line interface DECLSPEC_UUID("04598fc6-866c-11cf-ab7c-00aa00c08fcf") in mshtml.h
<br />
EXTERN_C const IID IID_IHTMLControlElement;<br />
<br />
#if defined(__cplusplus) && !defined(CINTERFACE)<br />
<br />
interface DECLSPEC_UUID("04598fc6-866c-11cf-ab7c-00aa00c08fcf")<br />
IHTMLControlElement : public IDispatch<br />
{<br />
public:
I am using VC6 SP6. This my first time working with CHtmlView and IWebBrowser2 classes and I can't even compile a sample
|
|
|
|
|
Can anyone please tell me how to create multiple windows that show up on the screen at the same time, and also if there is any libraries that support .gif within a window, if so, please point me in the right direction... thank you
|
|
|
|
|
I've not done multple seperate windows on the screen (under windows), but it should not be difficult (a window is a window). As for .gif support, well GDI+ probably supports that (SDK @ microsoft.com) and there are articles at CP that will direct you in the correct direction (namely CxImage).
Notes:
1) There are several aticles on GDI+ at CP.
2) Multple seperate windows: Child windows that are not resticted to diplaying inside the main application window.
3) You can probably create a non-child window by simply creating a window with the parent window set to NULL.
Any-way, just some thoughts off the top of my head.
I dought any of that helps but good luck, any-way.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|