|
|
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.
|
|
|
|
|
how to disable and enable any control i.e button ,edit box ,slider control etc in win32(not in MFC)
Ashish
|
|
|
|
|
|
For each action on the win32 you can use of some messages like:WM_ENABLE/WM_VSCROLL,and WM_* for use of them you need to use of SendMessage.
|
|
|
|
|
is there a way to write
<br />
ranges[1] = "0- 9";<br />
ranges[2] = "10-19";<br />
ranges[3] = "20-29";<br />
ranges[4] = "30-39";<br />
ranges[5] = "40-49";<br />
ranges[6] = "50-59";<br />
ranges[7] = "60-69";<br />
ranges[8] = "70-79";<br />
ranges[9] = "80-89";<br />
ranges[10] = "90-99";<br />
ranges[11] = "100";<br />
in the form of an array?
|
|
|
|
|
How about the use of multidimensional arrays.
<br />
int multi_array[11][10] = {{0, 1, 2, 3, 4, 5, 6, 7, 8, 9},<br />
{10, 11, 12, 13, 14, 15, 16, 17, 18, 19},<br />
{20, 21, 22, 23, 24, 25, 26, 27, 28, 29},<br />
{30, 31, 32, 33, 34, 35, 36, 37, 38, 39},<br />
{40, 41, 42, 43, 44, 45, 46, 47, 48, 49},<br />
{50, 51, 52, 53, 54, 55, 56, 57, 58, 59},<br />
{60, 61, 62, 63, 64, 65, 66, 67, 68, 69},<br />
{70, 71, 72, 73, 74, 75, 76, 77, 78, 79},<br />
{80, 81, 82, 83, 84, 85, 86, 87, 88, 89},<br />
{90, 91, 92, 93, 94, 95, 96, 97, 98, 99},<br />
{100}};<br />
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Hi all,
I've a stringstream and I want to remove first two bytes from it and make a new one with the rest of content. From 3rd byte to end. How can I do that.
I've try to remove first two characters but not work.
Please help me.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
I am not sure I can really catch your idea. please refer the below code:
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char** argv)
{
string whole_str;
string res_str;
whole_str = "Hello, this World";
res_str = whole_str.substr(2, string::npos);
return 0;
}
Chris Liu
|
|
|
|
|
Ok so i have tried, and failed epically, to use objects. Even simple ones.
Now its seems that I need more than ever to understand how to use them.
my coding project is random, dont ask what it is for because i dont actually know my self.
What it does it generates a random number from 0-25 that is then used to assign a letter from my array alpha to a variable. 3 letter variables, and 2 number variables in the so called 'Mas' statement (A1B2C) and then the there are 5 number vars in the so called 'Address' statement.
I plan to have a total of 4 'Mas' statements, and thus 4 'Address' statements for the whole application
You can see why i need to learn how to use objects.
Here is the code:
<br />
#include <cstdlib><br />
#include <iostream><br />
#include <cmath><br />
<br />
using namespace std;<br />
<br />
char masc1;
char masc2;<br />
char masc3;<br />
<br />
int masn1;
int masn2;<br />
<br />
int idx1;
int idx2;<br />
<br />
int idrt1;
int idrt2;<br />
int idrt3;<br />
<br />
char alpha[26] = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
int pre;
const int alphn = 26;
const int num = 10;
bool err = false;
<br />
void masgen()<br />
{<br />
srand( rand()*(unsigned)time( NULL ) );<br />
pre = (rand() % alphn + 2) % -alphn ;
masc1 = alpha[pre];<br />
idrt1 = pre;<br />
pre = (rand() % alphn + 2) % -alphn;
masc2 = alpha[pre];<br />
idrt2 = pre;<br />
pre = (rand() % alphn + 2) % -alphn;
masc3 = alpha[pre];<br />
idrt3 = pre;<br />
pre = (rand() % num + 2) % -num;
masn1 = pre;<br />
idx1 = pre;<br />
pre = (rand() % num + 2) % -num;
masn2 = pre;<br />
idx2 = pre;<br />
}<br />
<br />
void cker()<br />
{<br />
if( pre > alphn )
{<br />
cout << "Error. Pre > Alphn \n"; <br />
err = true;
system("PAUSE");<br />
} <br />
}<br />
<br />
int main(int argc, char *argv[])<br />
{<br />
while( err != true )
{<br />
masgen();
cker();
cout << "Mas: " << masc1 << masn1 << masc2 << masn2 << masc3 << '\n';
cout << "Address: " << "E" << idx1 << idx2 << "X" << idrt1 << idrt2 << idrt3 << '\n';
system("PAUSE");<br />
}<br />
system("PAUSE");<br />
return EXIT_SUCCESS;<br />
}<br />
|
|
|
|
|