|
CPallini wrote: Path = "abcd";
Path += "abcd";
I think not.
MVP 2010 - are they mad?
|
|
|
|
|
Well, you should ask MS to change the documentation [^], [^] and, above all, persuade the compiler of ...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Apologies, you are, or should be, right. I really need to stay away from MFC questions.
MVP 2010 - are they mad?
|
|
|
|
|
Thanks guys,
I also realized that hardcoding a path(even relative) is stupid and in fact I could not get it to work. I found the following superior method that I had used elsewhere-
char acPath[256];
if ( GetModuleFileName( NULL, acPath, 256 ) != 0) {
* ( strrchr( acPath, '\\' ) + 1 ) = '\0';
}
|
|
|
|
|
al2500 wrote: I once tried to research unicode v.s. Multi-Byte Character Set and I could not make heads or tails of the significance.
Unicode is usually a 16-bit (sometimes 32-bit) encoding of a character set. Multi-byte character sets (e.g. UTF-8) are encodings where each character is represented by one or more bytes. In each character the left most bit(s) of the first byte indicate how many bytes make up each character. In the ASCII set of characters in the range 0x00 to 0x7F each character is one byte long. There is some useful (and well explained) information here[^].
MVP 2010 - are they mad?
|
|
|
|
|
Hi:
I am migrating from VS 6.0 to VS 2008 and I am stuck on this error.
error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'const char [13]' (or there is no acceptable conversion)
It is occurring here:
istream & operator>>(istream &stream,IOwnship &object)
{
//## begin IOwnship::operator>>%.body preserve=yes
char tempStr[80]={0};
UINT16 temp16;
stream >> (ISimObj&)object;
int i;
for( i=0; i<IOwnship::NUM_EXPENDABLE_SLOTS; ++i){
stream >> object.m_expCount[i] >> temp16;
object.m_expType[i] = (ExpendableType)temp16;
}
stream >> temp16; object.m_fuelType = (FuelType)temp16;
for(i=0; i<NUM_FUEL_TANK_TYPES; ++i){
stream >> object.m_fuelQty[i];
}
UINT32 malfID;
UINT16 malfStatus;
UINT16 moreMalfs;
stream >> "Malfunctions";
for(stream >> moreMalfs; moreMalfs; stream >> moreMalfs){
stream >> malfID >> malfStatus;
object.m_malfStatusMap[malfID] = MalfStatusActType(malfStatus);
}
I have included:
#include <iostream>
using namespace std;
This works fine in VS 6.0.. any help would be greatly appreciated
|
|
|
|
|
mlchavez wrote: stream >> "Malfunctions";
You are trying to read from stream into a constant, I don't think this will work; and even if it did it would serve no purpose.
MVP 2010 - are they mad?
|
|
|
|
|
thank you for the speedy reply.
I really appreciate the help 
|
|
|
|
|
I hope it helps to solve your problem.
MVP 2010 - are they mad?
|
|
|
|
|
mlchavez wrote: stream >> "Malfunctions";
Are you sure this will work with VC 6.0?
|
|
|
|
|
I am programming a console application that plays .wav files. I have set the members of the WAVEFORMATEX to the values of the read file. As a try, I set the lpData member of the WAVEHDR member to the buffer where the file was read into and the dwBufferLength to the size of the file. I have also prepared the WAVEHDR structure. This plays the file when I call the Sleep function for some seconds (Not the best approach) after calling waveOutWrite. I have read that files should be played using double buffering approach but I don't know how this is implemented. I used a callback function in the waveOutWrite function and I am also able to trap WOM_DONE and WOM_OPEN messages.
Please I need help on how this double buffering sheme is implemented. I have read that when one buffer is being sent, the other is being prepared but I don't know how to do this. Some tutorials may help to get the idea.
Please help me.
|
|
|
|
|
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=4422&lngWId=3
|
|
|
|
|
Hi
Is it possible to use Google Map in a MFC application? I want to read in the roadway map (traffic network) data.
Is there a sample for it?
Thanks,
Zhen
|
|
|
|
|
CODEPC wrote: Is it possible to use Google Map in a MFC application?
I don't think so, but read here just in case.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
I have seen an MFC application that uses Google Map to load roadway map into the application's window. The program is a custom made highway information system. That means it is possible to do it. However, I don't have access to that program, therefore, I can't show you how they did it.
|
|
|
|
|
Could you tell me a little more about the highway information system? like any information related to it. Name? web pages?
Thank you so much,
|
|
|
|
|
I guess you could always embed a web browser control in your MFC application and navigate it to Google maps
|
|
|
|
|
Hey guys, i am having problem in putting the str i want to search for using find().
I have a text file which hold data like this :
"ewcwecwcdwecwewewe"<eddwdwwee>""d"dsdad"d""dd ewfewfwe"wewe"
What the problem is , i want it to search for "d". the issue is , when i put it into the code below
string.find( ""d"dsdad"d"" , 0) ;
what happens is that , it is unable to read the variable to search for properly as it contains "" also.
thus, it will just "dsdad and miss out the d and ".
what can i do to solve this problem?
|
|
|
|
|
I don't konw if you meant this.
But try \" for every quote you need to search for.
Example:
string.find( "\"\"d\"dsdad\"d\"\"" , 0) ;
Should find ""d"dsdad"d"" in the string.
Greetings
Covean
|
|
|
|
|
The outline of the problem:
I have an exe which will be displaying the status of various pieces of remote equipment in the form of icons and screens.
The remote equipment is NOT defined at this stage so I want a DLL which I can NAME in a setup file, load, and which has a standard interface to my main exe. The interface (at the moment) is 'load', 'giveMeStatusIcon', 'updateStatus' (largely so I can force the change of the status icon), 'showStatusScreen'
The basics of loading a DLL from a name, getting the interface, calling the functions above all work. I can on my 'exe' screen show the returned status icons - these icons are resources in the dll and returned as icons for my exe to display
The problem comes when I ask it to show the status screen. This screen is defined in the DLL resource, and thats the way I want it - I don't want my exe to have to worry about what is in that DLL screen, what it does or how it does it. The DLL gets called, loads the dialog resource ok, but the DoModal call causes an assert - the DLL is not a CWinApp so DoModal can't apparently work.
I guess one possible way is to stop creating a DLL and create an EXE, start that and setup some inter process comms to deal with the communication. But I would much rather stick to the plan of using a DLL.
Does anyone have any suggestions?
Note I do NOT want to write all possible remote device DLL's now and start putting .h files in my exe, I want to stick to the basic idea of having these as items I can develop next month, next year, or whenever and use frmo my exe via loading of a dll file with a fixed API (at least to my exe) at run time.
|
|
|
|
|
DaveHitchman wrote: The DLL gets called, loads the dialog resource ok, but the DoModal call causes an assert - the DLL is not a CWinApp so DoModal can't apparently work.
What is the assert you get, and why are you calling DoModal() on something that won't handle it? Assuming your DLL is pure Win32 then you should be able to do this without any problems using the DialogBox() [^] function.
MVP 2010 - are they mad?
|
|
|
|
|
Hi All,
I am creating a formview application in MFC.I have added some normal controls on it like buttons,checkboxs etc.I have also added Microsoft Forms 2.0 command buttons(ActiveX Controls) on it.The problem i am facing is that, when i add the WM_PAINT handler to the CFORMVIEW class and run the application,the activex controls are not getting displayed on the form.
Kindly help me in this.
Thanking you in advance,
Ashwath.
|
|
|
|
|
Hey guys, could i check with something
What i would like to do is to be able to input a number and using that number as the index , it will start finding where a certain line is (in this case yht) from there. for example
int main ()
{
string s("abcdefghijleeeeeeeyhtpr") ;
string::size_type loc2 = s.find( "yht" , 0 ) ;
cout << loc2 << endl ;
the input will be 18 , as it starts counting from the start of the string. What i would like to know is, am i able to set a variable in the find syntax? instead of putting 0 , can i declare a variable and then can the sting.find() read it?
So , if i were to input in 3 , how can i declare this and then put it into the find statement? Hope for some help. thanks
|
|
|
|
|
I I'm missing something or you are asking for (I cannot believe it...)
string::size_type s = 3;
s.find( "yht" , s ):
?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Sorry, what i meant is this
int main ()
{
string s("abcdefghijleeeeeeeyhtpr") ;
int now = 6 ;
int nowe = 3 ;
int result = nowe - now ;
string::size_type f = result ;
string::size_type loc2 = s.find( "yht" , f ) ;
cout << loc2 << endl ;
cout << f << endl ;
when i tried running this , i got the result displaying (4294967295 ). why is this? are we not allowed to use the variable (result) and put it to size_type f = result? is it not the same as size_type f = 3?
|
|
|
|