|
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?
|
|
|
|
|
well, nowe-now is -3 , then cast it to unsigned ...
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]
|
|
|
|
|
gregarion wrote: when i tried running this , i got the result displaying (4294967295 ). why is this?
Perhaps because f (and result ) is -3 .
"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
|
|
|
|
|
gregarion wrote: What i would like to do is to be able to input a number and using that number as the index
What about:
int index;
cin >> index;
string::size_type loc2 = s.find("yht", index);
"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
|
|
|
|
|
Thanks guys, i got it. the issue was i thought that the output will start counting from the index i told it to. it only searches starting on the index, but output will be based from counting from the start of the file. Thanks!
|
|
|
|
|
Hallo,
I need to determine the current installed language of the os in Visual C++ 6.
Can someone help me? With which class I can get this value? Is it saved in the registry?
Thank you for helping me!
|
|
|
|
|
See the section here[^] on Locales and other regional options.
MVP 2010 - are they mad?
|
|
|
|
|
|
there is a problem existed in window7 and vista, if we set the autorange for the desktop application, that we can't send LVM_SETITEMPOSITION message, or it'll always return FALSE, why? it can take effect in windows xp.
|
|
|
|
|
The MSDN documentation[^] states:
On Windows Vista, sending this message to a list-view control with the LVS_AUTOARRANGE style does nothing, and the return value is FALSE.
I think you will need to talk to Microsoft for an explanation.
MVP 2010 - are they mad?
|
|
|
|
|
|
so, i can't exchange the position of the list items with the LVS_AUTOARRANGE style, my god.
|
|
|
|
|
That sounds quite reasonable if you have specified that they should be arranged automatically.
MVP 2010 - are they mad?
|
|
|
|
|
but it can exchange items' position if you dragging the icon on the desktop within the application of explorer.exe, i want to have the utility in my own application, how can i do? thanks in advance
|
|
|
|
|
Well I guess you need to suppress the auto arrange feature and implement it within your own code so that it looks the same. I have no idea how explorer does this, you might try asking Microsoft.
MVP 2010 - are they mad?
|
|
|
|
|
thanks for your advice
|
|
|
|
|
Hi,
I need to create a process like
LPTSTR szCmdline[] = TEXT("ffmpeg -i " + ofn.lpstrFile + " -r 1 -ss 00:00:10 -vframes 1 -f image2 " + Buffer + "\\Initframe10.bmp");
For this I will be using CreateProcess API but problem is how to convert TCHAR to a LPTSTR lpCommandLine to be passed to CreateProcess?
ofn.lpstrFile (LPTSTR type) is obtained as outcome of GetOpenFileName API Call and Buffer (TCHAR type) is obtained as GetTempPath.
I get compilation errors which I am not able to fix. (I am new to Win32 programming so this may sound naive).
Can someone please help me in fixing the errors?
Thanks
modified on Thursday, January 28, 2010 7:30 AM
|
|
|
|