|
It may have something to do with me not using SetModified()...
-- modified at 12:58 Thursday 16th November, 2006
|
|
|
|
|
Hi,
I'm porting one of the dll from vc6 to vc8. In doing so I have created a complete framework to create a dll and subseqently add atl objects.
By default the framewaork adds the follwoing code in the main app file
class MyClassModule : public CAtlDllModuleT< MyClassModule>
{
public :
DECLARE_LIBID(LIBID_MyClassLib)
DECLARE_REGISTRY_APPID_RESOURCEID(IDR_MYCLASS, "{7C00C752-3DA7-4CB9-B721-7F39F9FEDD2E}")
};
In previos versions of ATL CComModule _Module was used which has been replaced by CAtlBaseModule.
Problem:
There was an extern declaration as extern CComModule _Module in stdafx.h and definition in main app file as CComModule _Module .as CComModule is known to stdafx.h all other classes could use _Module and calls its methods by including stdafx.h
How do I replicate the above behaviour in the new version?
How do I use the functionality of the class MyClassModule in other modules as this class is defined in my app file as MyClassModule but this MyClassModule is not known to stdafx.h and thus all ther classes cannot see the definition of MyClassModule.
|
|
|
|
|
I have a file is one of my projects which stores data and behaves as a circular buffer. Since the data need not be stored continiously in the file, I would like to enable and disable "Read only" property of the file as per the requirement.
So I have written the following code for the file.
ofstream _logs;
const char* _file = "xxx.txt"
ofstream _logs(_file, ios::out,ios::trunc)
The file properties will be handled using the APIs
SetFileAttributes(), GetfileAttributes()
Now I would like to control the data written into file externally from the file properties menu. But I when I uncheck the "Read Only" check box on the file's property menu from windows explorer, the files still behaves as Read Olny and the data does not get written into the file.
Please suggest a solution for this.
|
|
|
|
|
koumodaki wrote: SetFileAttributes(), GetfileAttributes()
Should not be any problem with these API's.
koumodaki wrote: But I when I uncheck the "Read Only" check box on the file's property menu from windows explorer, the files still behaves as Read Olny and the data does not get written into the file.
Could there be other reason for this ? other that 'readonly' property.
Apprantly it should work.
|
|
|
|
|
koumodaki wrote: But I when I uncheck the "Read Only" check box on the file's property menu from windows explorer, the files still behaves as Read Olny...
How are you verifying this?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
There is a thread in my application which should write a data continiously.
As soon as the Read Only property is unchecked, a thread in my application will start writing into the buffer. I am not seeing this happen
-- modified at 10:24 Thursday 16th November, 2006
|
|
|
|
|
Hi just a quick question.
How can i set the style of a ListView control to LVS_REPORT. I have searched and only found a method that doesnt work for VS2003.NET - Basically right click the control and change the sytle property. The property doesn't appear to be there.
I am sure I am missing something simple but oh well cant see the forrest for the trees.
Cheers
Dan
|
|
|
|
|
Its there, in properties-->Appearance-->view .
I'm using VS2005 though.
|
|
|
|
|
Thanks - that solved the problem - cant beleive i didnt spot that
Thanks again
|
|
|
|
|
Its very difficult to be familiar with changed IDE, And again in this case, Its very easy to miss out.
|
|
|
|
|
In addtional you can set it with ModifyStyle
|
|
|
|
|
Also programmatically on init:
BOOL CListViewDerivedClass::PreCreateWindow(CREATESTRUCT& cs)
{
// Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
//--THIS LINE HERE--
cs.style |= LVS_REPORT;
return CListView::PreCreateWindow(cs);
}
|
|
|
|
|
Dear All,
#import "msxml4.dll"
using namespace MSXML2;
I am declaring these two lines in Dialog based application its giving errors.
But it works with VC++6.0 Win32 Console Application.
I dont know why ?
Kindly help me.
|
|
|
|
|
|
list of "ambiguous sysmbol" errors ..
|
|
|
|
|
I'm not getting any errors. Which IDE you are using ?
Infact, I'm not getting errors on VS6 and VS8.
Can you show exact error, you are getting.
|
|
|
|
|
Unfortunately, what worked in VC++ 6.0, no longer works in VC++ 2003. I'm not sure what version your using but we have to resort to using the scope resolution operator when programming MSXML in VC++ 2003.
Comment out the using namespace MSXML2[^]
|
|
|
|
|
|
Hi all,
Is it possible to use the strncpy() function to achive the following:
FileName1.txt to FileName1.abc
I have tried the following:
<code>
int ExtensionLen;
char *ExtensionString;
ExtensionString = FileNameFromClient;
ExtensionLen = strlen(ExtensionString) - 4;
char extstring[20];
strncpy( (char*)extstring, ExtensionString, ExtensionLen );
strcat((char*)extstring,(char*)".tcp");
</code>
Just to change the extension, or is there something else I could use?
Thanx
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
If you want to do it in plain old C, here is a way:
char fileName[20];
strcpy(fileName, "FileName1.txt");
// Now change extension to ".abc"
// "Smart" coding, assumes there is a dot in the filename
strcpy(strrchr(fileName, '.'), ".txt");
OR (safer):
char * cpDot = strrchr(fileName, '.');
if(NULL != cpDot) strcpy(cpDot, ".txt");
Let the flaming begin! (I won't answer, I have work to do).
-- modified at 8:30 Thursday 16th November, 2006
Thanks, toxcct!
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
this will do if the file name contains only one '.'.
if the file is called for instance foo.test.doc, your code will fail.
|
|
|
|
|
Thanks for pointing that out. It's fixed now.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Thank you toxcct ...
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Thank you kakan for the reply, I'll try it. And I don't think this senario will happen:
file1.a.txt
Thanx again
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Hello.
Anyhow, I've fixed it, when toxcct pointer it out to me.
I changed strchr to strrchr.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|