|
Better to handle using CImageList it will be easy and convenient. Please try in this way.
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
Hello everyone,
What is the scene behind the option of merge proxy/stub code in ATL project? My confusion is, COM (in-process server) is a DLL, proxy is another DLL normally, how could two DLLs be merged into one DLL?
thanks in advance,
George
|
|
|
|
|
George_George wrote: My confusion is, COM (in-process server) is a DLL, proxy is another DLL normally, how could two DLLs be merged into one DLL?
For the most part, you can put whatever you want in a DLL. Perhaps you could be more specific about your confusion?
led mike
|
|
|
|
|
Thanks led mike,
I have made more study by myself. Do you think my following understading are both correct?
- If separate coclass code and proxy code into two DLLs, under Windows registry, we need to register coclass DLL under coclass CLSID and register proxy DLL proxy coclass CLSID;
- If bundle coclass code with proxy code, under Windows registry, we register both the DLL (bundled) under both original coclass CLSID and proxy coclass CLSID.
Both are correct?
regards,
George
|
|
|
|
|
George_George wrote: - If separate coclass code and proxy code into two DLLs, under Windows registry, we need to register coclass DLL under coclass CLSID and register proxy DLL proxy coclass CLSID;
- If bundle coclass code with proxy code, under Windows registry, we register both the DLL (bundled) under both original coclass CLSID and proxy coclass CLSID.
Both are correct?
I don't know because I don't really understand what you said, but basically because you start each statement with "if" I would say, NO not correct.
You seem to be over complicating the issue, something it seems you frequently do. There is no "if". There must be a registry entry pointing to the DLL that the component is in, period. No "if" for pointing to the DLL, it must be done, always, period.
Your question seems to be focused on the COM Proxy. To find the Proxy the registry mapping entry[^] is used. Since this mapping is a pointer to another CLSID then that CLSID must have an entry that points the DLL just as we stated above.
Also Make sure you understand COM Apartments and Marshalling[^] to be able to understand the Proxy Registry entries.
led mike
|
|
|
|
|
Thanks led mike,
I have made some study. Sorry that I think my bad description before makes your confused. English is not my native language.
Could you help to review whether my following understandings are correct?
1. when using merge option in ATL, only one DLL file will be generated, and it will be registered under both original coclass CLSID and the IID mapped proxy CLSID;
2. when not using merge option in ATL, two DLLs will be generated, one for original coclass object and the other for the proxy object, and they are registered separately under original coclass CLSID/ and the IID mapped proxy CLSID.
regards,
George
|
|
|
|
|
Hi Friends,
I need to get all the files from a directory in an array. But i cant use CFileDialog..
The path is constant like "C:\\JPEG". From this folder i need to get all the files.
Could any one help me find out.
Thanks in advance...
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
FindFirstFile/FindNextFile
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
See the sample from MSDN. Hope you can use MFC
void Recurse(LPCTSTR pstr)
{
CFileFind finder;
CString strWildcard(pstr);
strWildcard += _T("\\*.*");
BOOL bWorking = finder.FindFile(strWildcard);
while (bWorking)
{
bWorking = finder.FindNextFile();
if (finder.IsDots())
continue;
if (finder.IsDirectory())
{
CString str = finder.GetFilePath();
TRACE(_T("%s\n"), (LPCTSTR)str);
Recurse(str);
}
}
finder.Close();
}
void PrintDirs()
{
Recurse(_T("C:\\JPG"));
}
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
|
Use the CFileFind class.
1) Use CFileFind::FindFile() and CFileFind::FindNextFile() to iterate through the directories and files.
2) Use CFileFind::IsDirectory() function to determine whether its file/folder and just add it to your array.
3) You can get the file name by using CFileFind::GetFileName() and file path by calling CFileFind::GetFilePath() .
if you need the windows api itself, have a look at FindFirstFile() and FindNextFile() .
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Little late..
Some body didn't like it
Regards,
Sandip.
modified on Wednesday, August 6, 2008 6:59 AM
|
|
|
|
|
My keyboard is a bit slow.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Don't worry pal!
I've voted a 5.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
santhoshv84 wrote: I need to get all the files from a directory in an array. But i cant use CFileDialog..
Even if you could, why would you want/need to?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi Friends,
I have written the following code for knowing whether i have access to a particular directory.
CreateFile( (LPCTSTR)szDir, 0, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
where szDir is "C:\\ProgramData\\NewFolder" . It has all kind of access permission.
This is working fine in all OS,but not in Vista.
Can someone tell me the reason.
I am getting ACCESS_DENIED on Vista.
Please try the same on your machine and you will also see same behavior.
Thanks in advance.
Appu..
"Never explain yourself to anyone.
Because the person who likes you does n't need it.
And the person who dislikes you won't believe it."
|
|
|
|
|
NiceNaidu am getting ACCESS_DENIED on Vista.
I read lot of similar problem with vista in past few days on this forum and always solution was you require Administrator access.
Regards,
Sandip.
|
|
|
|
|
To execute your code in Vista you would need to run your application under the admin account. Does your code work when you are logged in as an admin
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I am running as Administrator.
Appu..
"Never explain yourself to anyone.
Because the person who likes you does n't need it.
And the person who dislikes you won't believe it."
|
|
|
|
|
Are you trying to create directory using CreateFile ??
An application cannot create a directory by using CreateFile, therefore only the OPEN_EXISTING value is valid for dwCreationDisposition for this use case.
Regards,
Sandip.
modified on Wednesday, August 6, 2008 6:43 AM
|
|
|
|
|
No. I am trying to check whether i have access permissions to an existing directory.
Appu..
"Never explain yourself to anyone.
Because the person who likes you does n't need it.
And the person who dislikes you won't believe it."
|
|
|
|
|
MSDN documentation says
To open a directory using CreateFile, specify the FILE_FLAG_BACKUP_SEMANTICS flag as part of dwFlagsAndAttributes. Appropriate security checks still apply when this flag is used without SE_BACKUP_NAME and SE_RESTORE_NAME privileges.
Regards,
Sandip.
|
|
|
|
|
Thanks Sandip..It is working.I missed out that point, though i read the documentation.
Appu..
"Never explain yourself to anyone.
Because the person who likes you does n't need it.
And the person who dislikes you won't believe it."
|
|
|
|
|
Welcome
Regards,
Sandip.
|
|
|
|
|
One solution is Disable the User access control.
1. Launch MSCONFIG by from the Run menu
2. Click on the Tools tab. Scroll down till you find "Disable UAC" . Click on that line.
3. Press the Launch button.
4. A CMD window will open. When the command is done, you can close the window.
5. Close MSCONFIG. You need to reboot the computer for changes to apply.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|