|
Hi,
Actually speaking there is no declared limit for the
number of messages. But if the same messages are being
sent continuously - you could test by using
PeekMessage and remove the trailing messages
for each message(the specific kind) you are processing.
|
|
|
|
|
Thank you Prem for your suggestion.
The same message is being sent continously and each message is important to be processed. However, I don't quite understand what you mean by the trailing messages. Could you elaborate on that?
|
|
|
|
|
There is no practical limit, that I know of. Are you losing messages? How far behind is the worker thread that receives the messages? If the thread spends a significant amount of time waiting, you have extra cycles available. You could try using more that one thread to relieve the bottle neck.
|
|
|
|
|
Thank you for your suggestion, Bill. I will try to look into that.
|
|
|
|
|
I write an Application which uses another DLLs.
In the DLL_DS, it contain a DataService class, which with functions to get something from the database, and return the list of something, say:
<br />
CSimpleKeyList *CRebDataService::GetSimpleKeyList()<br />
In the DLL_TY, it holds the basic definition of some class, say:
<br />
class CHRISTINE_EXPORT CSimpleKeyDetail <br />
{<br />
public:<br />
CSimpleKeyDetail();<br />
virtual ~CSimpleKeyDetail();<br />
<br />
CString GetKeyID() const;<br />
long GetKey() const;<br />
CString GetKeyName() const;<br />
<br />
void SetKeyID(const CString& keyid);<br />
void SetKey(const long key);<br />
void SetKeyName(const CString& keyname);<br />
<br />
protected:<br />
<br />
CString m_KeyID;<br />
long m_Key;<br />
CString m_KeyName;<br />
};<br />
One of header file of DLL_TY defines the template of CDualMapListType (which is just a std::map), and
<br />
typedef CDualMapListType<CSimpleKeyDetail> CSimpleKeyList;<br />
The Application includes the header file, and is getting a CSimpleKeyList *plist from DLL_DS, but when loop through the list, an access violation occurred.
<br />
for (itr=plist->begin();itr!=plist->end();itr++)<br />
{<br />
CSimpleKeyDetail *pKeyDetail = itr->second;<br />
keyid = pKeyDetail->GetKeyID();
<br />
... ... ...<br />
}<br />
Now, I am wondering if CString can be passed between the DLL and the App, or even I can't pass the pointer to a std::map from DLL to the app, where memory is allocated in the DLL, and deletion is in the Application.
Can anyone showe me the hint ??
Thanks very much
|
|
|
|
|
This gets asked every so often. You'll be safe if all the components that make up the program (main app and DLLs) use the same DLL version of the C run-time library (i.e. no static linking of the run-time). Try it, it should work.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I've checked all the DLL's and the App are using Debug Multithreaded DLL in all Project Settings.
The strange is, in the map I contain two elements, I can get the first one with itr->second. However, for the second one, I get the CSimpleKeyDetail * with itr->second, it returned an address of cdcdcdcd. It makes me confused.
By the way, I'm using VS6 SP5 in Windows XP box.
|
|
|
|
|
Will it be any chance that the standard library (std::map) is using *another* method to allocate memory, so the memory is invalid after passing through DLL - App boundary ?
|
|
|
|
|
I think my problem is this one :
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q172396
After studying, I'll tell how do I solve it. Thanks ^^
|
|
|
|
|
Hi,
I really want to know who worked with advanced scsi programming and VC++
in this disscuss list?
I have done some works in recent two weeks with the help of the disscussion board, including finding all the drivers, read/write datas from/to cd-rom, insert/eject cdroms and ...
by using aspi32scsi code. As a comparison, Would you please show me similar works or some
materials about this topic?
Thanks in advance!
chen
|
|
|
|
|
This one has me a bit stumped.
I used Erik T's excellent ATL object wizard and tutorial articles to make a toolbar (like the CP toolbar), and I have added a button to the Standard Buttons bar of Explorer which pops the toolbar on and off. Works fine...
...except for one sniggly little feature.
The docs tell you to create two icon files or resources - one with 16 (16c) and 20(256c) bit gray images, and one with like sized 'hot' or color images. Ok sure fine. When IE loads, it checks whether its set to display small or large icons and gets the right ones to use for the SB bar button.
The problem arises when the user selects 'Customize' and changes from small icons to large or vv. The gray icon gets selected ok, but the color one becomes a 'dithered' (for lack of a better term) version of the one currently being shown. This can really mess up the quality of the hot image, until the user either goes back to the icon size in force when IE loaded or reloads IE.
I've noticed another quirk that can happen when a control specifies a single icon resource/file, or the one loaded previous (listed prior in the reg settings) has only one or the wrong icons - the icon for one can appear in the standard button for the other! This leads me to suspect that there is some image list indexing going on, but haven't gotten far on that track.
Toolbars like Google and CP avoid this aspect of adding to the Standard Buttons bar. If I could find a sample that did this correctly, that would help - or even find the IE icons in .ico or resource form, though I'm not sure they exist as such.
Has anyone any insight here? I realize its not a show stopper, but its dang annoying.
Any hot leads, musings, or even sentences starting with 'ya know I think I once...' and/or ending with '...can't for the life of me remember where' will be muchly appreciated.
|
|
|
|
|
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
|
|
|
|
|