|
I doubt it'll help you much, but the normal IE icons are kept in browseui.dll. They're just bitmaps, all the hot buttons in one, all the gray in another, separate ones for 256 color, etc.
--------
You can change the extention so it reads ASP even though it is PHP which is kind of cool. - Martin Marvinski --Shog9 --
|
|
|
|
|
Thanks - that may help!
Will 'av a go...
|
|
|
|
|
I once discussed the "wrong size icon being shown" problem with Erik. (I had in mind a button for the Standard toolbar that would open the CP home page.) Neither of us could come up with a fix, though.
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
|
|
|
|
|
Thanks Mike
So... better minds than mine have failed... hmmm... what would Poirot do...
|
|
|
|
|
ok, this is my code:
char ID::SetID(char SID[11])
{
char *pID[11];
char SSID[11];
pID = &SSID;
*pID = SID;
strcpy(&M_ID, SSID);
return 0;
}
//i got my code to work with one character, now i want to make it work with more like 10
i have one problem "yet again" and it deals with the line:
pID = &SSID; //i dont understand my error.
this is the error:
error C2440: '=' : cannot convert from 'char (*)[11]' to 'char *[11]'
what does (*) mean, and: is there another way to declare a pointer to point to somthing?
Thanks for your help!
~SilverShalkin
|
|
|
|
|
if pSID is NUL terminated string then code is:
char ID::SetID(char *pSID)
{
strcpy(&M_ID, pSID);
return 0;
}
if pSID array of char then code is:
char ID::SetID(char *pSID, int isize = 10)
{
memcpy(&M_ID, pSID, isize);
return 0;
}
soptest
|
|
|
|
|
You would do better to use std::string instead of char arrays.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Christian Graus wrote:
You would do better to use std::string instead of char arrays.
Is this an automated reply to any query on using char*s or CStrings?
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
char*, yes. CString or _bstr_t, no. std::string is not as complete as it could be, I use it where it does all I need, otherwise I reach for one of the other string classes, ( although we do not use MFC here ), but I would pretty much never use a char *.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Christian Graus wrote:
I reach for one of the other string classes, ( although we do not use MFC here ),
non-MFC and non-STL string classes???
ATL?
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
_bstr_t wraps a BSTR and a char *, so they are interchangable. CComBSTR is a BSTR wrapper. Both are used in COM, but I don't think they are specific to ATL. We have a class derived from std::string called CString which does a lot of what the MFC one does. ( Yes, I know you should not derive from std::string, I was not here when they did it ).
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Hi!
The char *pID[11] declare an array of 11 pointers to char
The char SSID[11] declare an array of 11 char
So I think you mean char (*pID)[11]
Anyway you can not do *pID=SID because *pID is not a l-value so you have to use a function like memcopy ... or strcopy if it is a string
Bye,
Orbital^
...the night is long ... but not long enought to do some real coding ...
|
|
|
|
|
Orbital^ wrote:
Anyway you can not do *pID=SID because *pID is not a l-value so you have to use a function like memcopy ... or strcopy if it is a string
that makes more sense! so everything dealing with arrays, do not set equal, yet, strcpy() and memcpy()?
i'll look through some more things, and try it again!
Thanks everybody!
i alos will check out std::string
~SilverShalkin
|
|
|
|
|
zenix2 (Visitor) May 29, 2002
Hi, I have this simple little program I need to complete for a course I am taking and am finding it impossible to organize my Grid.
The code I have so far is:
void CFGridDlg::LoadData()
{
//Get the grid row count
int liCount;
//Initialize the random number generator
srand((unsigned)time(NULL));
//Create and array
for (liCount = m_ctlFGrid.GetFixedRows();
liCount < m_ctlFGrid.GetRows(); liCount++)
{
//Generate the first Column (Jan) values
//m_ctlFGrid.SetTextArray(GenID(liCount, 0), StringValue(1));
//Generate the second column (Jan) values
m_ctlFGrid.SetTextArray(GenID(liCount, 1), StringValue(1));
//Generate the third column (Feb) values
m_ctlFGrid.SetTextArray(GenID(liCount, 2), StringValue(1));
//Generate the fourth column (Mar) values
m_ctlFGrid.SetTextArray(GenID(liCount, 3), StringValue(1));
//Generate the fifth column (Apr) values
m_ctlFGrid.SetTextArray(GenID(liCount, 4), StringValue(1));
//Generate the sixth column (May) values
m_ctlFGrid.SetTextArray(GenID(liCount, 5), StringValue(1));
//Generate the seventh colummn (Jun) values
m_ctlFGrid.SetTextArray(GenID(liCount, 6), StringValue(1));
DoSort();
}
}
int CFGridDlg::GenID(int m_iRow, int m_iCol)
{
//Get number of columns
int liCols = m_ctlFGrid.GetCols();
//Generate ID's. based on number of Rows, the current row, and the current column
return (m_iCol + liCols * m_iRow);
}
CString CFGridDlg::StringValue(int m_iColumn)
{
//The return Str.
CString reStr;
//Random Value ID
int raCase;
//Set the selection to column 1
//m_ctlFGrid.SetCol(1);
{
//Generate random val.
raCase = (rand() % 5);
//What val was generated?
switch (raCase)
{
case 0: //Rent
reStr = "$650.00";
break;
case 1: //Insurance
reStr = "$259.00";
break;
case 2: //Utilities
reStr = "$130.00";
break;
case 3: //Car payment
reStr = "$220.00";
break;
case 4: //Loans
reStr = "$60.00";
break;
default: //Credit cards
reStr = "$30.00";
break;
}
}
return reStr;
}
void CFGridDlg::DoSort()
{
//Set the current column to column 1
m_ctlFGrid.SetCol(1);
//Set the selection to all columns
m_ctlFGrid.SetColSel((m_ctlFGrid.GetCols() - 1));
//Ascending sort
m_ctlFGrid.SetSort(0);
}
I have experimented with all I could think of and have reached wits end I think. The top row is supposed to be Jan - June and column 0 is supposed to be "Rent/Mortg., Insurance, Utilites, Car Payment, Loans, and Credit cards." I've been able to set all this up, but the values in order for the columns by row are supposed to be 650.00, 259.00, 130.00, 220.00, 60.00, 30.00"
My code makes multiple entry of the same values and leaves some entries out.
Your assistance would be really appreciated.
Thanks,
Garry
|
|
|
|
|
Do you need to use Flexgrid ? Chris Maunders grid control canes it, you can get it here on CP.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Yeah, the assignment calls for FlexGrid.
|
|
|
|
|
Hi All,
A Quick question. I am trying to create controls on a form at run time, in a CFormView derived class. I have got the following code, which is trying to create a static label on the form, that should display the word "Test". I got the styles and extended styles for the window from looking at another static labels properties in Spy++. This is in my CFormView derived class's OnInitialUpdate:
HWND hWndTest = CreateWindowEx(
WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR | WS_EX_NOPARENTNOTIFY, // extended window style
"Static", // registered class name
"Test", // window name
WS_VISIBLE | WS_CHILDWINDOW | WS_GROUP | SS_LEFT, // window style
30, // horizontal position of window
30, // vertical position of window
40, // window width
20, // window height
m_hWnd, // handle to parent or owner window
NULL, // menu handle or child identifier
NULL, // handle to application instance
NULL // window-creation data
);
The thing is, I get a static label on the form, that is in fact displaying the word "Test", but it looks different than the static labels that I put on the dialog template. The font is bold, or something.
Anybody ever done this before? Why would this produce a different lookin label than doing it the normal way?
Thanks,
Aaron
|
|
|
|
|
You need to set the font for the created control. When you design a form using the resource editor it sets a default font for you (you can change it). This is not the standard system font which is the default for controls to draw with. You need to GetFont() from your dialog and SetFont(GetFont()) for your created control.
|
|
|
|
|
Thanks! That worked like a charm.
|
|
|
|
|
Hi all, I just want wanted to know what the best way of loading a binary file was without using MFC (I can do it using CFile and CArchive). At the moment I want to load in a file format that composes of 7 integers into 7 different variables. I'm also a bit worried about the robustness of the procedure. At the moment I have:
#include fstream
ifstream fin(FilePath, ios::binary)
if (fin)
{
fin.read(var1, sizeof(int));
fin.read(var2, sizeof(int));
etc.
}
fin.close();
but this seems remarkably inefficient as opposed to using the (arrow, arrow)operator as with MFC. Is this the best way to do this kind of thing? I know there is a function fin.eof() which tests for the end of the file, but surely I can't add that before each variable extraction? Its more used for text files and character extraction isn't it? I just need the best way of going about loading the data in this format into the seven different variables WITHOUT MFC. Thanks to all who are thinking about a solution.
Alan.
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
If the numbers are stored in binary format, then your code is just fine, and probably is as efficient as any MFC method. iostreams also have operators << and >> , but these are meant to handle numbers expressed in text mode. The code can be refined a little with the use of exceptions:
ifstream fin;
fin.exceptions(ifstream::eofbit|ifstream::failbit|ifstream::badbit);
try{
fin.open(FilePath, ios::binary);
fin.read(var1, sizeof(int));
fin.read(var2, sizeof(int));
...
}
catch(ifstream::failure& e){
}
fin.close();
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks for the reply Joaquin, I was wondering how to use the try catch exceptions without MFC (I have used CException but obviously can't if I'm not using MFC) and you have given it to me on a plate, so many thanks for that . I also thank you for reaffirming the loading method, you know sometimes when you get that feeling when something doesn't quite feel right (thats what I got)? I think your example looks a lot sweeter, mind, with the try catch stuff in it, its exactly what I was looking for. Again, many thanks Joaquin, may the code be with you.
Alan.
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
I have a problem converting a CComBSTR to LPCTSTR with CW2CT. Eveything works fine until my CComBSTR gets around 64 caracters... then the result of the convertion is a long "corrupted" string: "îþîþîþîþîþîþîþîþîþîþîþîþîþîþîþ...."
Please help me !
-----
See comments between /* */ for more info
-----
LRESULT CListBoxDlg::OnBnClickedBtngetselitems(WORD , WORD , HWND , BOOL& )
{
LPCTSTR sTitle;
int arrSelList[12];
TCHAR pszBuf[128] = "";
int iMaxNum = 12;
LRESULT iSelCount = 0;
LPCTSTR sMsg = 0;
CComBSTR bsMessage;
iSelCount = this->SendDlgItemMessage(IDC_AVSCODES, LB_GETSELITEMS, WPARAM(iMaxNum), LPARAM(arrSelList));
if (iSelCount != LB_ERR) {
bsMessage.Append("You have selected the fields: ");
_stprintf(pszBuf, "%li", arrSelList[0]);
bsMessage.Append(pszBuf);
for (int i = 1; i < iSelCount; i++) {
bsMessage.Append(", ");
_stprintf(pszBuf, "%li", arrSelList[i]);
bsMessage.Append(pszBuf);
}
bsMessage.Append(".");
sMsg = CW2CT(bsMessage.m_str);
sTitle = _T("Selected Items List");
::MessageBox(this->m_hWnd, sMsg, sTitle, MB_OK);
}
return 0;
} ompared to ATL 3.0
*/
sMsg = CW2CT(bsMessage.m_str);
/*
// The following two lines makes it work fine but USES_CONVERSION is not supposed
// to be needed with ATL 7.0
USES_CONVERSION;
sMsg = W2CT(bsMessage.m_str);*/
sTitle = _T("Selected Items List");
::MessageBox(this->m_hWnd, sMsg, sTitle, MB_OK);
}
return 0;
}
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
J.-C. Gauthier - http://www.grandmenhir.com/
|
|
|
|
|
This is the problem:
TCHAR pszBuf[128] = "";
buffer size is for 64 wide char's
soptest
|
|
|
|
|
even with 1024 it doesn't work
TCHAR pszBuf[1024] = "";
maybe there is something else I need to do.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
J.-C. Gauthier - http://www.grandmenhir.com/
|
|
|
|
|