|
Try this .....It will work.
AFX_MANAGE_STATE(AfxGetStaticModuleState());
SAMPLEdlg = new CSAMPLEDlg();
SAMPLEdlg->Create(IDD_VPUI_DIALOG,NULL);//DoModal();
SAMPLEdlg->ShowWindow(SW_SHOW);
SARVEJANA SUKINOBAVANTHU
regards,
Ashok
|
|
|
|
|
Where do i write this code (Dll program or the program that is using Dll)?
Bye.
|
|
|
|
|
In DLL u write this code in open interface function
then respective dialog will be opened based on dialog ID
regards,
SARVEJANA SUKINOBAVANTHU
Ashok
|
|
|
|
|
hi i want to use scripting.filesystemobject as we normally use in asp/vb.any idea how to use that in vc++.like in vb we use..
<br />
Dim FileObject<br />
Set FileObject = CreateObject("Scripting.FileSystemObject")<br />
i want to use same like code in Vc++. any ideas.
Regards.
Tasleem Arif
|
|
|
|
|
_tasleem wrote: Scripting.FileSystemObjec
What about CFileFind class!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
no,The work done next with these file system objects is not present in CFileFind,
actually i will use that to hide the Folders,There is api SetFileattributes but when i click on menu show hidden files then through Filesystemobject it is not visible which i want but visible through SetFileAttributes() api which i dont want.
hope this help to suggest u better.
Regards.
Tasleem Arif
|
|
|
|
|
_tasleem wrote: The work done next with these file system objects is not present in CFileFind
Wouldn't it be better to find out what the FileSystemObject is doing and reproduce it using the API (which FileSystemObject is using itself)?
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
yes,but i had not found any such api.I had found one as i previously mentioned but that does not work 4 my requirements.
Regards.
Tasleem Arif
|
|
|
|
|
_tasleem wrote: yes,but i had not found any such api.I had found one as i previously mentioned but that does not work 4 my requirements.
first import dll :-
#import "Scrrun.dll" rename("scripting","Scripting") raw_interfaces_only
then this code :-
Scripting::IFileSystemPtr fileSysPtr;
Scripting::IDrivePtr drvPtr=NULL;
Scripting::IFolderPtr folderPtr=NULL;
str.LockBuffer
CLSID fileSys;
HRESULT hr;
CLSIDFromProgID(L"Scripting.FileSystemObject",&fileSys);
fileSysPtr.CreateInstance(fileSys);
hr =fileSysPtr->CreateFolder(L"C:\alok123",NULL);
BSTR fileDirectory;
hr = fileSysPtr->GetDriveName(L"D:\\alok",&fileDirectory);
hr = fileSysPtr->GetDrive(fileDirectory,&drvPtr);
CoUninitialize();
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Thanks Very much sir. for such a hard work.
Regards.
Tasleem Arif
|
|
|
|
|
_tasleem wrote:
hanks Very much sir. for such a hard work.
Mention Not!
<div class='ForumSig'>"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you </div>
|
|
|
|
|
it did not work give error at line where folders is created. here is piece of code in vb which i want to convert to vc++.is there is any help or any article about above classes i tried but there is not intellisense in my stdio about these classes.
<br />
Dim FileObject<br />
Dim GFolder<br />
Set FileObject = CreateObject("Scripting.FileSystemObject")<br />
Set GFolder = FileObject.GetFolder(txtPath.Text)<br />
GFolder.Attributes = -1<br />
Regards.
Tasleem Arif
|
|
|
|
|
_tasleem wrote: Dim FileObject
Dim GFolder
Set FileObject = CreateObject("Scripting.FileSystemObject")
Set GFolder = FileObject.GetFolder(txtPath.Text)
GFolder.Attributes = -1
CoInitialize(NULL);
Scripting::IFileSystemPtr fileSysPtr;
Scripting::IDrivePtr drvPtr=NULL;
Scripting::IFolderPtr folderPtr=NULL;
CLSID fileSys;
HRESULT hr;
CLSIDFromProgID(L"Scripting.FileSystemObject",&fileSys);
fileSysPtr.CreateInstance(fileSys);
_bstr_t bstFolder(L"C:\\alok123");
hr=fileSysPtr->GetFolder(bstFolder,&folderPtr);
folderPtr->put_Attributes(Scripting::Hidden);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
its working but its work is line the setfileattribute api i mean i only hide the folders which is visible when we click on show hidden files.
Regards.
Tasleem Arif
|
|
|
|
|
Use
COleDispatchDriver FileObject;
COleException oleException;
if ( !FileObject:CreateDispatch( _T("Scripting.FileSystemObject"),&oleException ) )
return;
and then InvokeHelper...
Hope this helps...
-- modified at 8:14 Monday 4th December, 2006
|
|
|
|
|
BadJerry wrote:
COleDispatchDriver FileObject;
COleException oleException;
if ( !FileObject:CreateDispatch( _T("Scripting.FileSystemObject"),&oleException ) )
i wasted two hour finding that function.. but failed.. so i try to implement that by Vc++ way .. i.e. importing scrrun.dll!
<div class='ForumSig'>"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you </div>
|
|
|
|
|
hi, if i use MFC AppWizard to create the workspace of dialog application, it will create :
title.cpp
ReadMe.txt
title.clw
title.cpp
title.dsp
title.dsw
title.h
title.plg
title.rc
StdAfx.cpp
title.rc2
titleDlg.cpp
titleDlg.h
however, may i know whether i can create another source file ,for example, titleCtrl.cpp by using appwizard to generate the basic file.
if i click new->source file, it will just create an empty .cpp file
Thanks for any reply
|
|
|
|
|
cyn8 wrote: generate the basic file.
if i click new->source file, it will just create an empty .cpp file
Thanks for any re
exactly what do you want?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
actually i wan to create a .cpp file to the project. Is it possible to create an additional .cpp file with the basic code and working just like when i use the mfc wizard exe.
Can i do it by creating a new class for custom control?
i'm using a dialog based application.
|
|
|
|
|
you can do it by clicking new->source file and then you create an empty .cpp file
but you must include the file StdAfx.h if you want to go on.
is it right?
just do it
|
|
|
|
|
actually i wan to create a .cpp file to the project. Is it possible to create an additional .cpp file with the basic code and working just like when i use the mfc wizard exe.
Can i do it by creating a new class for custom control?
i'm using a dialog based application.
|
|
|
|
|
The appwizard can set up a class associated with a dialog template for you. Beyond that, I'm not sure what you're hoping for, the wizard can't do much more for you, as there's not much more boiler plate code to be had.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
You can use AppWizard to create an empty .cpp file, or you can use ClassWizard (Ctrl+W) to create a class derived from some other class. Either way, the file is added to the project.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I have overridden the OnPaint() API in a dialog based application to give the dialog box a rounded rect shape using CRgn.
<br />
CRect rect;<br />
GetClientRect(&rect);<br />
CRgn rgn;<br />
<br />
rgn.CreateRoundRectRgn(0, 0, rect.Width(), rect.Height(), 30, 30);<br />
<br />
SetWindowRgn((HRGN)rgn.GetSafeWnd(), TRUE);<br />
After that I have painted the inside of the Rgn giving it a gradient background as explained in one of the articles by Mr. Nishant.(using bitblt())
Now I want to draw a boundary to this rounded rectangle.
I tried FrameRgn() API but the gradient painting drew over the boundary.
I also tried FrameRect() API after gradient painting, selecting the NULL_BRUSH. But all I got was a black Rounded Rectangle.
How do I draw a boundary to the Rounded Rectangle without sacrificing my gradient background?
Cutebug
|
|
|
|
|