|
I don't want a link obviously, that's why I put "shell extension" into my subject line
Andreas Saurwein wrote:
The other way requires a extending the explorer namespace (think twice before you say 'thats what i need')
I don't need it really. But I want it. Any pointers, articles...?
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
|
fileName is the name of the file I just created some lines above the WinExec Command.
I have an Object f of CStdioFile type, I open it in creation mode, I write in it with f.WriteString and then close it. I want to launch a Notepad to preview its content, Notepad starts but the content of file is not displayed, if I click on File>Open>file name, it works and content is displayed .
Format of WinExec and content of fileName are correct because using the same instruction a the beginning of my routine (before open/write/close), I can start a notepad displaying the file previously created.
It is just like the file is not yet available for notepad even if a close is done ...!?
Any help is welcome
DD
|
|
|
|
|
Couldn't you open the file with nOpenFlags = CFile::shareDenyNone so that other apps have access to your file even when you have it open within your app?
Adam.
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
I would like to precise that I have tried to open my file with CFile::shareDenyNone because I thought problem was coming from a conflict but result was the same ...
|
|
|
|
|
DD,
Are you opening the file with just CFile::modeCreate? I have just put together an app to try to recreate your problem on VC6. Everything works just fine but you can't write to your file if you open in CFile::modeCreate only. It has to be CFile::modeCreate+CFile::modeWrite.
e.g.
CStdioFile file;<br />
file.Open("c:\\filetest.txt", CFile::modeCreate+CFile::modeWrite+CFile::shareExclusive,NULL);<br />
file.SeekToEnd();<br />
file.WriteString("this is written\n");<br />
file.Close();<br />
WinExec("c:\\WINNT\\notepad.exe c:\\FileTest.txt",SW_SHOW);
works fine and dandy.
CStdioFile file;<br />
file.Open("c:\\filetest.txt",CFile::modeCreate+CFile::shareExclusive,NULL);<br />
file.SeekToEnd();<br />
file.WriteString("this is written\n");<br />
file.Close();<br />
WinExec("c:\\WINNT\\notepad.exe c:\\FileTest.txt",SW_SHOW);
fails at WriteString() and never gets to WinExec.
If you post the code that's causing you a prob then perhaps we could have a look?
hope this helps
Adam.
P.S. would recommend using ShellExecuteEx rather than WinExec as you can get a handle to Notepad to see when it has terminated.
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
You don't need to use CFile::SeekToEnd
When you open the file you are creting the file, id for that you are in the end of the file....
Best Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Cheers pal..
I was testing the code out using modeRead, modeWrite and some other combinations to see if I could recreate Qadddd's problem. I kinda left the SeekToEnd() in there by accident. Cheers anyway!
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
The code looks like this (I am at work, not at home and doesn't have my source code near me)
===========================
CStdioFile f;
char pFileName[] = "myfile.txt";
char buff[] = "test string";
f.Open( pFileName, CFile::modeCreate | CFile::modeWrite | CFile::shareDenyWrite | CFile::typeText); // tested with CFile::shareDenyNone instead of CFile::shareDenyWrite but it doesn't correct
f.WriteString(buff); // and more writings
f.Close; // supposed to close file and make it available
WinExec("Notepad.exe myfile.txt",SW_SHOW)
===========================
The same WinExec instruction put at the beginning of my routine works fine if I launch it a second time and the content of the file created during the 1st pass is correctly displayed ...
Hope it is a little bit more clear....
|
|
|
|
|
Hmm..
Apart from changing f.Close; to f.Close(); and setting WinExec("Notepad.exe myfile.txt",SW_SHOW) to WinExec("c:\\WINNT\\Notepad.exe myfile.txt",SW_SHOW); it all works okay. It looks like one of those annoying ones that works on one PC and not the other!
I don't know if it is worth setting up a timer to send a WM_TIMER message and handling the message to open Notepad after about a quarter of a second or so and seeing what happens?
hope this helps. Sounds very perplexing!
Adam.
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
I need to buy a tool that manages the creation
of an executable files that self-installs the developed
application, all needed libraries (dll, ocx, ...)
and all files required by the application (database, configuration
files, ...) in order to simplify the installation procedure.
Does someone know which is an usefull tool ???
Thanks a lot.
|
|
|
|
|
|
|
Inno Setup is a Very good free tool that does just this.
There are two:
Inno Setup, www.jrsoftware.org - Free and creates very professtional looking installers.
Or you can use an enhanced version called,
My Inno Setup Extentions, http://www.wintax.nl/isx/ - this is Inno Setup +, still free but you can do some pascal scripting and add your own custom pages to the installation as well as installing from the internet.
Honestly, i have never come accross a situation where i have had to buy an installer since there are very good free ones arround.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Hi anthony,
Take a look at Ghost installer at www.ginstall.com, it can
register COM servers during install.
Bye,
Alwin
|
|
|
|
|
dear sir,
pls help me i have problem with CFtpFileFind
CFtpConnection *pFtp = oInternet.GetFtpConnection(szServerName,szUserName,szPassword,21,TRUE);
pFtp->SetCurrentDirectory(szRemoteDirectory);
CFtpFileFind ofinder(pFtp);
BOOL bWorking = ofinder.FindFile("*",INTERNET_FLAG_RAW_DATA | INTERNET_FLAG_RELOAD |INTERNET_FLAG_EXISTING_CONNECT );
my problem is in the above code when i give FALSE in GetFtpConnection(..) file finder is working fine .but i give TRUE(ie ,INTERNET_FLAG_PASSIVE) in GetFtpConnection(..) then call ofinder.FindFile(..) this function returns FALSE.
GetLastError() returns the errorcode 12029;
|
|
|
|
|
just chenge the last parameter a s false in GetFtpConnection().
WUSIWUG
|
|
|
|
|
Hello,
i have some problem with socket. My client is iPAQ and server a computer.
The client send some bitmap with IRDA;the code is
DEVICELIST devList;
int sizesock;
int count;
HANDLE HandleFile;
int byteread;
int i;
int len=sizeof(devList);
char buffer[4096];
TCHAR szerror[100];
SOCKADDR_IRDA address={AF_IRDA, 0,0,0,0, "c"};
SOCKADDR_IRDA d;
SOCKET sock;
SOCKET e;
DWORD WrittenNum;
if((sock=socket(AF_IRDA, SOCK_STREAM, 0))==INVALID_SOCKET)
{
wsprintf(szerror, TEXT("Errore"));
MessageBox(NULL, szerror, MB_OK);
return;
}
devList.numDevice=0;
while((devList.numDevice==0)&&(count<=NUMETENT))
{
getsockopt(sock, SOL_IRLMP, IRLMP_ENUMDEVICES,(char*)&devList, &len);
count++;
}
for(i=0; i<4;i++)
{
address.irdaDeviceID[i]=devList.Device[0].irdaDeviceID[i];
}
connect(sock, (struct sockaddr *)&address, sizeof(SOCKADDR_IRDA));
but i don't finish.
Help me?
Luca
|
|
|
|
|
If i want to send and receive bitmap, how i can do?
|
|
|
|
|
In Visual Basic 6, I want to make a mediaplayer executable using MS control: Mediaplayer to play mpg files.
I've got a problem if I opened the same movie object twice without knowing whether or not a same application was playing at the moment.
How can I determine the status of a mediaplayer obect so that when I play it for the second time, the first one, if still playing, can be stopped and closed?
I have tried to mediaplayer.stop and end the application when either form and mediaplayer losts its focus. It is supposed to work like this: when I run/play a second movie, the first one may lost focus and thus being stopped and closed. But it failed, i.e when I click the application twice, the second one will pop up and run, however, the first movie will be running simutaneously at background.
Any comments and suggestions?
Thanks in advance!
DJ
|
|
|
|
|
Ask this in the VB forum!!!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
I understand but I need it quite urgently.
Sorry for the inconveniece caused.
DJ
|
|
|
|
|
In creating a dialog indirectly, i have to specify the DLGTEMPLATE.x, y, cx, cy in dialog unit. However, I only have the pixel positions at hand. How can i do conversion on it before the dialog is created ?
|
|
|
|
|
How about using:
MapDialogRect() and GetDialogBaseUnits() (see MSDN)??
You create the dialog but before you make it visible use these functions to make any changes to the dialog you need. If you must get these figures before you create the dialog and are not using the system font then you need to get the text metrics of the font you wish to use and do the conversion yourself.
hope this helps.
Adam.
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
I do this in my constructor:
class CMyClass
public:
CMyClass() throw CMyException()
{
...
throw CMyException(234);
}
...
the compiler says "Cannot convert from int to CMyException"
daah!?!?!??!!?!?
How do I implement exceptions in my class!?!?!?!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|