|
Hi all,
Does anyone of you know how I can change the cursor type of the text editor in Visual Studio 2005?
This tiny cursor drives me crazy
Thank you.
modified 7-Mar-17 12:13pm.
|
|
|
|
|
Hi all,
I want to store some data in a map as a pair. Just see what I have done in the following code, then you can have a clear idea.
<br />
string user_key[5] = {"cocacola", "pepsi", "cocacola", "mango", "pepsi"};<br />
int comm_val[5] = {23, 45, 24, 67, 98};<br />
<br />
map<const string, int> comm_map;
map<const string, int>::const_iterator iter;<br />
<br />
for(int i = 0; i < 5; i++)<br />
{<br />
iter = comm_map.find(user_key[i]);<br />
<br />
if(iter == comm_map.end())<br />
{<br />
comm_map.insert(pair<const string, int>(user_key[i], comm_val[i]));<br />
}<br />
else<br />
{<br />
(*iter).second = comm_val[i];
} <br />
}<br />
<br />
for(iter = comm_map.begin(); iter != comm_map.end(); iter++)<br />
{<br />
string rec = iter->first;<br />
int val = iter->second;<br />
<br />
cout << rec << "\t" << val << endl;<br />
}<br />
<br />
<br />
My result should be as commented at last of the code. Can you help me to fix it.
Thanks
I appreciate your help all the time...
CodingLover
|
|
|
|
|
I've workout with the index, as follows.
comm_map[user_key[i]] = comm_val[i];
Is that right?
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Hi, in MFC 2003, Is that possible to create two executable files (.exe) one for GUI and one for command line, so I can choose to run the application via GUI or via command line
Thanks
Arif
|
|
|
|
|
One way to do it would be to separate your 'core' from your UI. If you develop a dll (or a lib file) which contains all the core functionalities, that will be easier to develop the two other applications. But of course, you will still need to develop them and the way you will do it really depends of what you need to do.
|
|
|
|
|
Thanks for the quick reply,
I 've put all of my core functionalities in different classes, and the problem is I don't know how to creating command line executable files, because when the first time, I create MFC Dialog Based Not Command Line Application, Any suggestion?
Thanks
Arif
|
|
|
|
|
Do it as I suggested: create three projects in your solution. One for the dll (or lib), one for the dialog based app and one for the command line app.
|
|
|
|
|
HI, Sorry for the late reply,
I decided to create class that inherits from commandlineinfo
and until now, I dont have any issues
Anyway, Thanks for your help
Regards,
Arif Liminto
|
|
|
|
|
|
Hi, I have a application which opens MS-Office documents (Word,Excel,PPT). While opening Word file OLE creates ~WRO0001.doc" file. When user right click on this file, it opens this file in WinWord with options available (e.g. New,Open,Edit).
I want to disable this right click menu (Context menu). Please let me know is there any way to block this context menu for Office applications (e.g. .doc files) i.e I dont want this file to open outside of my application.
Thanks
SNI
jhghjghj
|
|
|
|
|
Trying to block the WM_RBUTTONxxx, WM_CONTEXTMENU, etc. in the PreTranslateMsg of the main window may help you. You have to replace these messages with WM_NULL and allow the message processing.
Please note that I didn't try it for Word or Excel, but tried for some others and the result was success...
|
|
|
|
|
Hi!
how do i create a wincows mobile program with VC++ 2003 or VC++ 6.0 ?
Zo.Naderi-Iran
|
|
|
|
|
Hi!
what diffrence is between IT and IAT?
i want an document for this topic
Zo.Naderi-Iran
|
|
|
|
|
Hi all,
How to create a csv file in a dialog based MFC application?
Thank You,
SeshaSridhar
|
|
|
|
|
u can create the csv file this way
FILE *fp;
fp = fopen("output.csv","w");
Hope it helps u
|
|
|
|
|
|
Can someone tell me how to use WriteProfileString and GetProfileString mFC functions????
this is my CODE...
it executes....But Data not getting WRITTEN to INI file....
why?????????
code:
void CFileApp::OnView()
{
free((void*)m_pszProfileName);
m_pszProfileName=_strdup(_T("C:\\MyFile.ini"));
WriteProfileString("1", "Name", "MATHEW");
}
|
|
|
|
|
I think you asked similar questions some days ago I think this article is helpful for you.CIniFile[^].
|
|
|
|
|
anna mathew wrote: WriteProfileString
As I told to you many, many, many, many, many times, WriteProfileString writes to the registry (from this [^] MSDN page)
Remarks
The entries are stored as follows:
* In Windows NT, the value is stored to a registry key.
* In Windows 3.x, the value is stored in the WIN.INI file.
* In Windows 95/98, the value is stored in a cached version of WIN.INI.
Use Win32 API 's WritePrivateProfileString instead.
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]
|
|
|
|
|
Ya,... now i know....
thanks...
|
|
|
|
|
how can i prevent overwriting to INI file....??
I mean Is There Any WAY TO CHECK IF THE SECTION NAME...
[section name]
already exists???
|
|
|
|
|
Yes, there is GetPrivateProfileSectionNames [^].
BTW: Be aware, you're just a step aside the feared RTFM.
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]
|
|
|
|
|
Hi,
maybe this is not so simple after all. The MSDN page says that WriteProfileString will write to the application's registry OR .INI file.
In my case, when I compile in XP using VisualC++ 6.0 the string is written to C:/WINDOWS/myappl.INI. I can find nothing in the registry.
Transferring the project to Vista and using visual Studio 2008, my application does not come up with a remembered string, the default is used instead. Nothing is found in the registry and I have found no myappl.INI file after running the appl a few times with a valid string.
|
|
|
|
|
In fact what the OP needs could be simply accomplished using WritePrivateProfileString .
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]
|
|
|
|
|
Hi,
yes, I noticed that in the discussion, but I am first trying to understand where
the WriteProfileString is actually writing things. The MSDN text is saying this OR that,
but not much about what is steering where things go. As I understand it, you should call
CWinApp::SetRegistryKey if you want to have things in the registry "Causes application settings to be stored in the registry instead of INI files".
I get further confused when the application is not working either way in Vista, no registry and no INI file.
|
|
|
|