|
Bad form. David is a very knowledgable man. He has helped many people on this forum. And yes I include myself in the list.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Well, since you're gonna act like that... I'll tell ya, but for a fee.
Now, if you want free advice, I suggest you quit whining like a spoiled brat. You'll improve your chances of getting it.
Jeremy Falcon
|
|
|
|
|
thanks in advance,
i am reading a file on a CD-ROM drive,
i first used CFile mfc library to read a file,
but it fails with Error Code (0x20) which is ERROR_BAD_UNIT
<br />
CFile aFile;<br />
aFile.Open("E:\\file.txt", CFile::modeRead | CFile::typeBinary)<br />
and
i also tested with FILE and fopen(...) , C library, it's ok
<br />
FILE *fp;<br />
fp = fopen("E:\\file.txt", "rb");<br />
what may be the problem ?
thanks again
|
|
|
|
|
Actually (0x20) is a hex number; you need to convert it to decimal.
32 ERROR_SHARING_VIOLATION - The process cannot access the file because it is being used by another process.
|
|
|
|
|
thanks first...
i changed my code to use CFileException as you mention
and found that m_cause gives me 11 which is
CFileException::sharingViolation : SHARE.EXE was not loaded, or a shared region was locked (msdn says...)
i think it's supposed to be working correctly though,
because when i read a file on a hdd, my app works fine
but when i changed target dir to CD-Rom, it fails with above reasons
may i miss something?
thanks
|
|
|
|
|
You can try to add CFile::shareDenyNone and see if that gets past the sharing issue.
|
|
|
|
|
i write follow code:
WCHAR cnt[100] = L"abc";
WCHAR* p = cnt;
wcscpy(p + 50, L"def");
i want print out "abc............def.....",but only get "abc"; "def" was lost.
someone may help me to resolve this problem?
|
|
|
|
|
hi
BSTR is capable of storing zero byte..
BSTR bs = ::SysAllocString(L"abc\0def" ); is valid.
i donno whether it will b a turning point for ur requirment.... try ..
for printing and all, i dont think it is possible... unless u write ur own custom printf or wsprintf.
rgds...mil10.
|
|
|
|
|
what about:
swprintf(outputbuf, L"%s%s", cnt, p+50);
|
|
|
|
|
hi all,
I have an ATL activeX DLL, I created my own file extension ( say .xyz) and made regisrty entries for opening test.xyz for the activeX control in the IE.
I objective is to render the contents of test.xyz into the broswer.
I am facing following problem.
How to pass the filename( test.xyz) when you double click on the file into the activeX control to render the file in IE.
I searched on CP but did'nt find anything related to it. may be i was on the wrong way. Can someone help me ?
Thanks in advance,
Abhi
|
|
|
|
|
hi all,
Found answer myself. may this be useful for someone.
1. Implement IPersistPropertyBagImpl interface for your class.
2. Override Load Method
Something like this:
<br />
STDMETHOD(Load)(IPropertyBag* pBag,IErrorLog *pErrorLog)<br />
{<br />
if(pBag == NULL)<br />
return E_POINTER;<br />
ATLASSERT(pBag);<br />
HRESULT hr = S_OK;<br />
CComVariant UrlString;<br />
hr = pBag->Read(L"src",&UrlString,pErrorLog);<br />
return S_OK;<br />
}<br />
In UrlString you will have the filename of the file on which you have clicked.
Thanks
Abhishake
|
|
|
|
|
MoveFile(it0->c_str(), tempFile);
MoveFile(it1->c_str(), it0->c_str());
MoveFile(tempFile, it1->c_str()) == 0);
on the second call to MoveFile everything crashes?
What am I doing wrong???
How does one execute a simple filename swap???
I'm using VC++ 6, Windows XP home
TIA!
How do I print my voice mail?
|
|
|
|
|
What do you mean "crash"?
What is the return value from the first call?
What is:
Hockey wrote:
MoveFile(tempFile, it1->c_str()) == 0);
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Thats a typo...ignore then == 0
When I say crash...I mean crash...like total application devistation...no error codes...more like an exception
How do I print my voice mail?
|
|
|
|
|
solved this yet?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Hockey wrote:
on the second call to MoveFile everything crashes?
This is a little vague. Does it stop on any particular line of code, like inside the string class?
First, are all the values correct for your strings? I'd be interested to know if tempFile is correct. I'm assuming this is a char[] rather than a stl:string?
Secondly, what about the return values from MoveFile - does the first one return TRUE? If not, what is the value of GetLastError.
Michael
CP Blog [^]
|
|
|
|
|
hi,
I am working in win32 SDK.
I want to display and save the watermark in a *.AVI file.
using activeX, i can display the watermark in a *.AVI file but i can not save that watermak in *.AVI file.
i want to save a watermark in an *.AVI file b/c user can see the watermark in any media player......
plz provide or suggest me a solution for saving a watermark in an *.AVI file.
regards,
bit_mca
|
|
|
|
|
Hi All,
I have 3 files in a project: o.h, green.cpp and blue.cpp.
o.h________________________________________
1: #ifndef __O_H
2: #define __O_H
3: class CO
4: {
5: public:
6: int m_iName;
7: CO() {m_iName = 2;}
8: CO(int i) {m_iName = i;}
9: CO(const CO& c) {m_iName = c.m_iName;}
10: };
11: #endif
green.cpp________________________________________
1: #include "o.h"
2: CO gO1(2);
blue.cpp________________________________________
1: #include "o.h"
2: extern CO gO1;
3: CO gO2 = gO1;
To make sure this project execution correctly, I
must run these files with the order:
...
green.cpp [line 2]
...
blue.cpp [line 3]
...
----------------------------------------------
Expected: green.cpp [line 2] is ran before run
blue.cpp [line 3].
If you have any solution, please show me how I
can do that (in MS Visual Studio C++ 6.0).
Thank you,
Nghĩa - I2A4U Group
|
|
|
|
|
In this case, the extern keyword will make the linker search other compiled modules for the declaraction of gO1 . It will find this from green.obj , and thus make external linkage with this variable.
In the sense of execution order, after the compiler has compiled the modules, the linker must add them in the order green.obj -> blue.obj . Otherwise the generated code cannot resolve the symbol gO1 .
In this solution, you are relying on the linker to determine the execution order. To have more control over the execution order, you should specify the main executable function ( int main(void) ), or the starting point function. Otherwise this piece of your code won't do anything.
One final option is to use the #include keyword at the start of blue.cpp to include green.cpp there. In this case, you also need to exclude green.cpp from the build. To do this, click on green.cpp in Solution Explorer, right-click, choose 'Properties' and mark it as 'Excluded from build'. Also, you don't need to include o.h in the blue.cpp anymore, as green.cpp already does that.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Antti Keskinen,
Thank you very musch.
------------------------------------------------------------------
That means we can not use MS VC++6.0 IDE to configure to
solve this problem?
It is ease to solve it by using link.exe in command line.
But I don't known why we can not use MS VC++6.0 IDE to solve it.
Thanks,
Nghĩa - I2A4U Group
|
|
|
|
|
Can I hook the OnNewWindow event without BHO?
Because if you use the BHO,you must write information in the register. But I don't want to write information in the register.
|
|
|
|
|
Please look at the this [^] article.
This may be a starting point for you.
Thanks
Abhi
|
|
|
|
|
Hello,
I am developing a program, Windows Xp/2000 based, that need to know the user account of the Windows. The program needs to verify that username and password match with the username and password entered in windows logon form appear for the first time.
1)How can i access the user account of the windows? Where is it can be found?
2)same as number 1) and do it programmatically?
3)Are there any resources that can help to do this?
Thanks
|
|
|
|
|
hello buddy,
search for Network Management Classes at cp,taht will solve all of your above listed problem.
-----------------------------
"I Think It will Work"
Formerly Known As "Alok The Programmer" at CP
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
I'm sorry, what is cp?
thanks
|
|
|
|