|
Thanks. It's worked fine for colored bmps.
Itziar
|
|
|
|
|
Hi !
I want to check if a specific folder exists. I looked in the MSDN but could not find anything...
Any idea ?
Thanks
|
|
|
|
|
Hello.
You can use stat() / _stat()
Or _access()
Kakan
|
|
|
|
|
Thanks
|
|
|
|
|
Try PathIsDirectory( ) or PathFileExists( )
Cheers
Jugs
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Hi,
CreateDirectory will return ERROR_ALREADY_EXISTS if the specific directory already exists.
Bye
Cool Ju
Dream Ur Destiny
|
|
|
|
|
if( (DWORD)-1 == GetFileAttributes(szDirectory) ){
// does not exist
} else {
// file or directory exists
}
|
|
|
|
|
Hi,
I am creating a shell namespace extension to show FTP files. I implemented cut / copy and paste using CFSTR_FILECONTENTS and CFSTR_FILEDESCRIPTOR. I implemented IDataObject and IStream for this. After copying, when I choose to paste the files, I am getting all the files, But the problem is that, the directory structure is not retained.
If I am copying a folder say "Test", which contains 2 files
1. a.txt
2. b.txt
When I choose paste, I am getting 2 files ( a.txt and b.txt ) and a folder ( Test ) in the same place. In fact it should have been folder "Test" and the two files inside "Test". But that is not happening.
I believe I am missing something here...
Could somebody please help me in resolving this.
Thanks and Kind Regards
Jugs
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
I have made an ActiveX control (.OCX) for web interface.
It has some member variables. And I had not implemented Get/Set methods for
those variables.
Throught the web page, I can set the values of above variables by <param> tag.
But now, I want to set the values of above variables by container application.
I made MFC application project by VC++. Above ActiveX control is inserted.
But, I cannot find the way to set the values of ActiveX's variables by the
same way as the <param> tag.
I think there is the way to set value to these variables because the Internet
Explorer can set without Get/Set methods.
How can I set the values of ActiveX's variables?
Please understand my poor English. English is not my mother tongue.
Following codes are some piece of my ActiveX control.
//################## SampleCtrl.cpp #########################
.........
void CSampleCtrl::DoPropExchange(CPropExchange* pPX)
{
ExchangeVersion(pPX, MAKELONG(_wVerMinor, _wVerMajor));
COleControl::DoPropExchange(pPX);
// TODO: Call PX_ functions for each persistent custom property.
PX_String(pPX,_T("sUserID"), strUserID );
PX_String(pPX,_T("sVerifyCode"), strVerifyCode );
PX_Short(pPX,_T("nLevel"), nLevel );
}
........
// ############## SampleCtrl.h #####################
class CSampleCtrl : public COleControl
{
....
private:
short int nLevel;
CString strVerifyCode;
CString strUserID;
};
// ############## test.html ####################
<OBJECT ID="Sample" WIDTH=340 HEIGHT=150 CLASSID="CLSID:D870D8B9-16CC-4445-9BE3-36BDFF5621E6">
<PARAM NAME="sUserID" VALUE="superman">
<PARAM NAME="sVerifyCode" VALUE="K4HVD-Q9TJ9-6CRX9-RQ2D3">
<PARAM NAME="nLevel" VALUE="3">
</OBJECT>
-- modified at 6:22 Thursday 24th November, 2005
|
|
|
|
|
If its your ActiveX control, then expose the variables using Properties. Create a new property for each of the variable and the IDE will generate the Getter and Setter.
From your HTML / Javscript code, you can directly access the variable using the property name as they are using IDispatch. From your VC++ code, you can use Getter and Setter methods.
Cheers
Jugs
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Thank you for your reply.
Yes, the ActiveX control is made by me.
But, I don't want to modify the ActiveX control at all.
Just I want to know how can access it's variables as the Internet Explorer.
If I will modify my ActiveX control, I can solve this problem.
But I cannot find the way to access to such variable without Get/Set methods.
Is there another way to access?
|
|
|
|
|
Hi,
I want to resize a control in list subitem as I increase or decrease
column width.I am handling this in OnCustomDraw() but it is flickering.I want to set SetRedraw() to TRUE and FALSE but in which event should I do that?
|
|
|
|
|
If the flickering occurs when you are resizing, then try calling SetRedraw() in your OnSize() handler.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Hi everyone!
Revising some code I've found this:
for(int i=0; i<m_aArray.GetSize(); i++)<br />
{<br />
...<br />
if(bCondition)<br />
break;<br />
}<br />
<br />
if( i==m_aArray.GetSize())<br />
{<br />
...<br />
}
That caused an ASSERT(HowCanItBe) into my brain. If "i" is declared into the
"for", how is possible to use it later? The code compile right, so Was I
wrong thinking that "i" _is_declared_ into the "for"?
Then, talking with the partners at work someone pointed out that in VS you
can do it, but in C++Builder it wouldn't compile.
The question is
What is the standard? And how are declared that kinds of variables?
And just testing I can do things like
for(int i=0; i<5; i++)<br />
{<br />
...<br />
}<br />
i = 6;<br />
for(int i=7; i<8; i++)<br />
{<br />
...<br />
}
what is the scope then?
Thank you in advance.
Regards.
|
|
|
|
|
I think the actual rule is that:
for (int i = 0; i < 10; i++)<br />
{<br />
}
//now i is invisible here.
But in VC6 it is visible after the for (...)
And I believe in VS .net compiler, they have complied with the standard and local variables are not visible outside anymore.
this is this.
|
|
|
|
|
Gizzo wrote: If "i" is declared into the
"for", how is possible to use it later?
In VS 2005 it's back to normal "i" won't be visible outside for
<marquee direction="up" height="30" scrolldelay="1" step="1" scrollamount="1" hspace="0" vspace="0">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
|
Hello,
I have a piece of c++ code – which I use in a COM DLL which takes a lot of time to execute (about 2 hours). Can anyone point me a good article that shows how to quite code execution after a specified period of time (lets say if method1 takes more than 5 minutes to return data than move forward). I know that this is possible using threads but I am curious if there a different way to solve this issue.
Thank you very much,
Regards,
Dan.
|
|
|
|
|
Respected All
Regards!
The article from Hermann about Print is
"Easy to use class for ScreenCapture to printer"
I used it and working well and i bcome able to take print while using this class brillient work by him but the always the print did not come on the center of the page and that's start print from the Top Left corner of the page, now i want to take Print at the center of the page.
the link of the page is
http://www.codeproject.com/printing/prntscreen.asp
please guide for possible change in this class so that i may able to take print at the middle of the page while printing.
Regards
David
david
|
|
|
|
|
why don't you ask on the forum at the bottom of the article ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
How can I avoid multiple instance of an MFC application? My C++ code didn't kill my application even I write exit(). I don't want to close application from task manager at each time. Any suggestions...
here is the my code that dosn't kill application.exe
try
{
m_pEtmenFed->flag=false;
Disconnect();
// I get an exception here
}
catch(...)
{
}
try
{
//This part doesn't work..
exit(m_nExitCode);
//CDialog::OnClose();
}
catch(...)
{
}
|
|
|
|
|
|
Here is how I solve this problem -> I have read about it on codeproject a few years I think:
In BOOL CXXXApp::InitInstance()
I have this piece of code:
HWND hWnd = ::FindWindow(NULL,"My Application Window Name"); <br />
if (hWnd) <br />
{ <br />
::ShowWindow(hWnd, SW_SHOWDEFAULT);<br />
::BringWindowToTop(hWnd);<br />
::SetForegroundWindow(hWnd);<br />
return FALSE; <br />
}
So if the window is present the new instance will bring it on top and returns FALSE which closes the new instance.
Regards,
Dan.
|
|
|
|
|
micutzu wrote: HWND hWnd = ::FindWindow(NULL,"My Application Window Name");
Oops could lead to hang ups. I did this once it got hung up. The article referred to by toxcct is a good one.
<marquee direction="up" height="30" scrolldelay="1" step="1" scrollamount="1" hspace="0" vspace="0">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
I have taken this error from code referred by toxct
Etmen.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CInstanceChecker::~CInstanceChecker(void)" (??1CInstanceChecker@@UAE@XZ)
Etmen.obj : error LNK2001: unresolved external symbol "public: struct HWND__ * __thiscall CInstanceChecker::ActivatePreviousInstance(void)" (?ActivatePreviousInstance@CInstanceChecker@@QAEPAUHWND__@@XZ)
Etmen.obj : error LNK2001: unresolved external symbol "public: int __thiscall CInstanceChecker::PreviousInstanceRunning(void)" (?PreviousInstanceRunning@CInstanceChecker@@QAEHXZ)
Etmen.obj : error LNK2001: unresolved external symbol "public: __thiscall CInstanceChecker::CInstanceChecker(void)" (??0CInstanceChecker@@QAE@XZ)
Debug/Etmen.exe : fatal error LNK1120: 4 unresolved externals
Error executing link.exe.
|
|
|
|