|
Fair enough. I had never seen it done that way before (I've never heard of "AtlAxWin"). I guess I learn something new every day it seems.
|
|
|
|
|
While this may be a Visual Studio feature request, does anyone know how to get the task list to scan all files in the solution rather than the current file. This is very annoying, and frankly the lack of it makes it useless.
Keep having to resort to Find in Files.
Not very slick.
Using VS 2005.
"Je pense, donc je mange." - Rene Descartes 1689 - Just before his mother put his tea on the table.
Shameless Plug - Distributed Database Transactions in .NET using COM+
|
|
|
|
|
Hello, could you please help me?
Here's an article:
http://www.codeproject.com/menu/bmpmenu.asp
The last comment is about using bitmap menu in dialog:
"I will use the MSDN example project dlgcbr32 to demonstrate this. Dlgcbr32 demonstrates how to add control bars to a dialog based application. Build dlgcbr32 and then follow these steps (the first 5 steps are essentially the same steps given in the original article):
1. Add these files to your project:
BitmapMenu.cpp, BitmapMenu.h, and winuser2.h
2. In Mdlsmain.h add this line:
#include "BitmapMenu.h"
3. In Mdlsmain.h inherit your modeless dialog from BitmapMenu:
class CModelessMain : public BitmapMenu<cmodelessdialog>
4. In Mdlsmain.cpp add two message handlers (the third message handler ON_WM_INITMENUPOPUP() is already there):
ON_WM_MEASUREITEM()
ON_WM_DRAWITEM()
5. In Mdlsmain.cpp at the end of the CModelessMain::OnInitDialog() function add the tool bar:
AddToolBar(&m_toolBar);
6. At the beginning of BitmapMenu.cpp add this line:
#include "Modeless.h"
7. At the end of BitmapMenu.cpp add this line:
template BitmapMenu<cmodelessdialog>;
8. In Mdlsmain.cpp at the beginning of the function CModelessMain::OnInitMenuPopup() add this line:
BitmapMenu<cmodelessdialog>::OnInitMenuPopup(pPopupMenu, nIndex, bSysMenu);
9. At the top of BitmapMenu.h add this line:
#include <afxcmn.h>"
The only thing that can't be compiled after perfoming all steps to use bitmap menu in dialog is this line:
CColorLBTestDlg::CColorLBTestDlg(CWnd* pParent /*=NULL*/):CDialog(CColorLBTestDlg::IDD, pParent)
The error i get:
error C2614: 'CColorLBTestDlg' : illegal member initialization: 'CDialog' is not a base or member
Thanks in advance!
|
|
|
|
|
Check your header file (.h) that contains the declaration for ColorLBTestDlg . If should include a line like this:
class ColorLBTestDlg : public CDialog {
Software Zen: delete this;
|
|
|
|
|
Nope, the class must be defined like this:
class CModelessMain : public BitmapMenu<CModelessDialog>
This is the author's idea.
|
|
|
|
|
You need to modify your constructor call to match the signature of his constructor, then.
Software Zen: delete this;
|
|
|
|
|
|
I've added a XML file to my resources which I load with FindResource/LoadResource.
My problem now is that I need to detect at runtime wheter it is UTF8 or UTF16. Is there any function that tells if a string is UTF8 or UTF16?
Thanks
|
|
|
|
|
If you created the resource string using MSXML then the string will be a BSTR which is UTF-16 by definition. Microsoft warns that the string will not contain the byte order mark that you normally can check for at the beginning of a disk file.
The thing to remember when parsing a BSTR string created with MSXML is that the line indicating the encoding will not reflect the actual encoding of the string.
In other words,
<?xml version="1.0" encoding="UTF-8"?>
in a BSTR representation should be ignored as the encoding will always be UTF-16.
|
|
|
|
|
|
|
Hi all,
i am required to write a simple BHO which changes the "User-Agent" Header for every HTTP-Request (has to be a BHO). I already had success with IWebBrowser2::Navigate for a single specific website. Is it possible to do this inline (Without (re-)navigate) and for any request done with the IE?
<br />
void CComServer::IEBeforeNavigate2(DISPPARAMS* pDispParams)<br />
{<br />
pDispParams = pDispParams;<br />
<br />
CComBSTR url = ((*pDispParams).rgvarg)[5].pvarVal->bstrVal;<br />
if (url == "http://www.url.com" )<br />
{<br />
CComPtr<IWebBrowser2> spBrowser;<br />
CComPtr<IDispatch> spDisp = ((*pDispParams).rgvarg)[6].pdispVal;<br />
spDisp->QueryInterface(IID_IWebBrowser2, (void**)&spBrowser);<br />
spBrowser->Stop();<br />
<br />
CComBSTR newURL = "http://www.google.com/";<br />
spBrowser->Navigate(newURL, NULL, NULL, NULL, NULL);<br />
((*pDispParams).rgvarg)[0].boolVal = TRUE;<br />
<br />
return;<br />
}<br />
Thanks in advance
|
|
|
|
|
hi..
i have an array of data i want to sort the data linearly..is there any way to do it..?
|
|
|
|
|
Use std::sort from the STL. For example to sort an array of int s:
int NumArray[] = {3, 1, 4, 1, 5, 9, 2, 6, 5};
int *pNumOnePartEnd = NumArray + sizeof(NumArray)/sizeof(NumArray[0]);
std::sort(NumArray, pNumOnePartEnd);
Remember to #include <algorithm> .
Steve
|
|
|
|
|
Stephen Hewitt wrote:
int NumArray[] = {3, 1, 4, 1, 5, 9, 2, 6, 5};
int *pNumOnePartEnd = NumArray + sizeof(NumArray)/sizeof(NumArray[0]);
std::sort(NumArray, pNumOnePartEnd);
should probably be pNumOnePastEnd
|
|
|
|
|
Yes, I did mean to write "one past the end". Note however that I made the mistake consistently so the example would still work.
Steve
|
|
|
|
|
Hi again guys
i have a strange problem.
i'm reading from a file character by character and i'm pushing the characters into a queue like this
<br />
do{<br />
c = getc (pFile);<br />
plainText.push(c);<br />
} while (c != EOF);<br />
so far so good then i copy the content of the queue into a string but i try to remove all unessesary spaces
<br />
string text;<br />
while (!PlainText.empty()) <br />
{<br />
if (PlainText.front()!=' ')<br />
{<br />
Plain_Text+=PlainText.front();<br />
PlainText.pop();<br />
}<br />
else if(PlainText.front()==' ')<br />
{<br />
while(PlainText.front()==' ' && !PlainText.empty() )<br />
{<br />
PlainText.pop();<br />
}<br />
Plain_Text+=" ";<br />
}<br />
<br />
}<br />
I'm not sure if i made my self clear so i'll give you an example.
lets say i have this writen in a file
<br />
This is writen in<br />
a text file but with more than one <br />
spaces in between the words
i want to copy the contents of this file into the string
but in this form
This is writen in a text file but with more than one spaces in between the words
My code doesn't make any changes it lives all the spaces as they where
any ideas pls help
Thanks a lot
-- modified at 6:13 Sunday 11th June, 2006
|
|
|
|
|
you didn't mention what type is your queue ? write here the definition of the queue
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
thanks for the reply my queue is of type char
queue<char>PlainText;
|
|
|
|
|
Do you want to convert a multiline string into a single line one. Although you talk about removing extra spaces but from the example it seems you want to remove newline ('\n') character.
-Saurabh
|
|
|
|
|
Hey thanks for the reply
yes i also whant to remove newline but spaces in between as well the example is not clear because when i post the message my spaces where removed.
|
|
|
|
|
antonaras wrote: ...when i post the message my spaces where removed.
Use ampersand nbsp; in your post.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
I have created a small project in vc++6 with a editable list control. I took the help of some of the articles found here.
I wanted the listview's edit box to have some background colour when that box is being edited. I intergrated another class I found in CodeProject. But the box doese'nt behave properly. I do not know how to correct it, or what I should change.
Can somebody help me out. I can e-mail the project to you so that you can see it and tell me what I must add or change.
Thanks.
Tara
Fortitudine Vinsinues!
|
|
|
|
|
use WM_CTLCOLOREDIT message in your class(derived CListCtrl) and use
<br />
HDC hdc=(HDC)wParam)<br />
::SetBkColor(hdc,RGB(53,197,200));<br />
whitesky
|
|
|
|
|
I have added that to the class. But this is what is happening:
When I click on a cell in the listview the background changes color. After that, when I start typing the color changes back to white and the corners remain yellow...
Please help!
Thanks.
Tara
Fortitudine Vinsinues!
|
|
|
|