|
Does any one know how to access the help button on a property sheet? I'm trying to use the resource editor, but all it lets me access are the individual pages. Thanks,
Ralf.
ralf.riedel@usm.edu
|
|
|
|
|
hi RalfPeter
You can't access the help button on the property sheet because you can't see the form, and that's pretty ennoying.
Doesn't it work when you add 'OnHelp' (message map) @ header file propsheet?
afx_msg void OnHelp();
void CMyPropSheet::OnHelp()
{
AfxMessageBox("onhelp");
}
Hope this works.
Just Modified
I fixed the problem by not using the standard help button but i created the button myself.
OnInitDialog:
CRect rect, tabrect;
//Get button sizes and positions
GetDlgItem(IDOK)->GetWindowRect(rect);
GetTabControl()->GetWindowRect(tabrect);
ScreenToClient(rect);ScreenToClient(tabrect);
int iWidth = rect.Width();
rect.left = tabrect.left;
rect.right = tabrect.left + iWidth;
m_ButtonHelp.Create("&Help",BS_PUSHBUTTON|WS_CHILD|WS_VISIBLE|WS_TABSTOP, rect, this, IDC_BUTTON_HELP);
//add IDC_BUTTON_HELP in RESOURCE.H yourself!!
m_ButtonHelp.SetFont(GetFont());
This creates the button + positions it correctly.
Then work with the previous code to catch the onclick.
Greetings
Jens
|
|
|
|
|
Exactly what do you mean by "access the help button?" Are you wanting to respond to the clicking of the Help button? As the property sheet is not based on a dialog template (like the property pages are), you obviously won't be able to alter it via the resource editor. The OK, Cancel, Apply and Help buttons are created dynamically.
See if the MSDN article Q132715 is of any help.
|
|
|
|
|
In my base class I have this (the base class is pure-virtual)
class CBase
{
protected:
bool m_bEnable;
public:
bool EnableMe( bool bEnable ) = 0;
}
and in each derived class, I have
bool DerivedClass::EnableMe( bool bEnable )
{
m_bEnable = bEnable;
}
would it be better to have :
class CBase
{
protected:
bool m_bEnable;
public:
bool EnableMe( bool bEnable ) { bEnable = bEnable;};
}
bool DerivedClass::EnableMe( bool bEnable )
{
CBase::EnableMe(bEnable);
}
Thanks,
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Hi,
it depends on the use of the class.
If you want to impement a interface class, then the pure virtual class should be used.
Keep in mind, that you cannot create instances (aka variables) of this class. Those classes can only be accessed by pointers.
You may write a function body for a pure virtual function, which may be called by any derived class. Resulting in a combination of your to proposals.
G. Steudtel
|
|
|
|
|
Hi,
I have a project that compile with the c2664 error.
error C2664: 'test' : cannot convert parameter 4 from 'void (int,float [],float [])' to 'void (__cdecl *)(int,float [],float [])'
None of the functions with this name in scope match the target type
// functions prototypes
void funcv (int n,float x[],float f[]);
void test (float x[], int n, int *check,
void (*vecfunc) (int, float [], float []));
How can I correct the functions prototypes to get a correct compilation ?
Thanks,
Claude
|
|
|
|
|
You haven't provided enough information. The compiler is not complaining about the prototypes. Show us the code snippet that calls the offending function (i.e., funcv, test).
|
|
|
|
|
Hi,
The function test is called like this:
CBroydn Broydn;
Broydn.test(x,N,&check,funcv);
I have to add that this code was working when I was utilizing thes functions inside a DLL.
Now I want to get out this code from the DLL. and I get this compile error c2664.
Thanks,
Claude
|
|
|
|
|
A hint might be the fact, that the compiler complains about converting a void parameter to a __cdecl function pointer returnig void. Looks to me, that the function prototype of 'funcv' is different. Probably of type pascal or samoething like that.
G. Steudtel
|
|
|
|
|
Show the protypes for funcv.
I think to use class methods as function pointers, you need to make the method static.
Jason Henderson My articles
"The best argument against democracy is a five-minute conversation with the average voter." - Winston Churchill
|
|
|
|
|
The interface IShellDispatch,has an updated interface named IShellDispatch2.
How to invoke IShellDispatch2 and all the members method.
Swarup
|
|
|
|
|
#define MY_SQL "INSERT INTO MyTable ([fldFileName]) VALUES ('%s')"<br />
sprintf(szStmt,MY_SQL, "Greensleeves.mp3"); <br />
SQLExecDirect(hStmt, (SQLTCHAR*)szStmt, SQL_NTS);<br />
<br />
#define MY_SQL "INSERT INTO MyTable ([fldFileName]) VALUES ('%s')"<br />
sprintf(szStmt,MY_SQL, "Souvenirs d'enfance.mp3"); <br />
SQLExecDirect(hStmt, (SQLTCHAR*)szStmt, SQL_NTS);<br />
Could you help me to fix this bug
thank a lot!!!
|
|
|
|
|
You should really have some sort of DB class that would automatically handle this kind of stuff for you, including replacing NULLs and such. An example would be the following:
int ApplicationInstance::StringReplace(char *cpSearch, LPCSTR cpFind, LPCSTR cpReplace, BOOL bDisableNULLCheck /*=FALSE*/, BOOL bReplaceEmbeddedQuotes /*=FALSE*/)
{
if (!cpReplace || (*cpReplace == 0 && !bDisableNULLCheck))
return 0;
int iRetval = 0;
BOOL bDeleteBuf = FALSE;
char *cpReplaceBuf = (char *)cpReplace;
int iReplaceLength = strlen(cpReplaceBuf);
int iFindLength = strlen(cpFind);
if (bReplaceEmbeddedQuotes && strchr(cpReplaceBuf,'\''))
{
LPCSTR cpQuote = strchr(cpReplaceBuf,'\'');
while (cpQuote)
{
iReplaceLength++;
cpQuote = strchr(cpQuote+1,'\'');
}
cpReplaceBuf = new char[iReplaceLength+1];
if (!cpReplaceBuf)
return -1;
char *cpDest = cpReplaceBuf;
cpQuote = cpReplace;
while (*cpQuote)
{
*cpDest++ = *cpQuote;
if (*cpQuote == '\'')
{
*cpDest++ = '\'';
}
cpQuote++;
}
*cpDest = 0;
bDeleteBuf = TRUE;
}
BOOL bSmaller = (iReplaceLength <= iFindLength);
char *p = strstr(cpSearch,cpFind);
while (p)
{
iRetval++;
// move rest of string so that the replace value fits right in.
if (bSmaller)
strcpy(p+iReplaceLength,p+iFindLength);
else
memmove(p+iReplaceLength,p+iFindLength,strlen(p+iFindLength)+1);
memcpy(p,cpReplaceBuf,iReplaceLength);
p = strstr(cpSearch,cpFind);
}
if (bDeleteBuf)
delete [] cpReplaceBuf;
return iRetval;
}
|
|
|
|
|
Hi,
I'd like to use system command but I don't like it to open console while the command is executing?
or if there is a c/c++ cmd for deleting all files in a directory like -
system("del /q *.*")
thanks
Yaniv
|
|
|
|
|
how about using ShellExecute method........
Swarup
|
|
|
|
|
Use SHFileOperation(). It supports wildcards.
|
|
|
|
|
|
I am having problems using the Adobe Acrobat ActiveX Control. I embed the control in a dialog box but when I try to generate a member variable to hold the control in Class Wizard an error is reported
"The ActiveX Control is not registered properly, or its type library number is incorrect. Try registering the control by removing and importing it in the Component Library"
Unregistering and registering the control doesn't help. So I'm not really sure where to go from here.
I am using Adobe Acrobat 5.0 (both the pdf.ocx and pdf.tlb files are present on my system)
|
|
|
|
|
The ActiveX is designed to make it difficult for you to use in an application. The pdf.ocx is not the real thing - the actual ActiveX control carries names like pdf42.ocx etc.
However, the class Id for the real ActiveX is
CLSID const& GetClsid()
{
static CLSID const clsid
= { 0xca8a9780, 0x280d, 0x11cf, { 0xa2, 0x4d, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0 } };
return clsid;
}
Use that in the normal CWnd derived class that the wizard will generate for you to hack it!
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
Paul Selormey wrote:
Use that in the normal CWnd derived class that the wizard will generate for you to hack it!
My problem is that when I try to have Class wizard generate something it reports the error I mentioned in my first post.
|
|
|
|
|
Raggamuffin wrote:
My problem is that when I try to have Class wizard generate something it reports the error I mentioned in my first post.
I know. This is because the pdf.ocx is only an automation interface OCX for the real pdf ActiveX control.
Use the Class Wizard and select the pdf.tlb, it will generate the Automation interface and empty event interface for you, say CPdf.
You may search your system to find the real ActiveX or use the ClassWizard to generate a wrapper for any simple ActiveX control, then delete everything with the exception of the Create and GetClsid methods.
Replace the GetClsid method with the one I have provided in my earlier reply. Create the window, use GetControlUnknown method to retrieve IUnknown interface, and the IDispatch interface from the IUnknown. Pass the IDispatch interface to the CPdf instance, and use the CPdf instance to control it. It has LoadFile, which you can use to open a file etc.
If it is getting confusing, write to me privately, I will try to help. If interested, I could write an article with sample for CodeProject
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
Hi.
I am trying to upload a variable and file thru POST thru HTTP. The script is not getting both. IE works fine and I tried to use same headers as of IE> but still it doesnt work.
I also tried to send one variable thru multipart/form-data. but its not working.
Here is the code for sending one variable.
CInternetSession session;<br />
CHttpConnection *http=session.GetHttpConnection("192.168.0.2");<br />
CHttpFile *pFile=http->OpenRequest(CHttpConnection::HTTP_VERB_POST,"/bluestar/post1.php",NULL,NULL,NULL,"HTTP /1.0",INTERNET_FLAG_RELOAD);<br />
<br />
CString sContent;<br />
sContent= CString(HTML_BOUNDARY)+"\r\nContent-Disposition: form-data; name=\"packet\"\r\r";<br />
sContent+="Faizan";<br />
CString sEnding="\r"+CString(HTML_BOUNDARY)+"\r";<br />
<br />
<br />
sContent+=sEnding;<br />
CString sPacket;<br />
CString str; <br />
sPacket="Accept: */*\rAccept-Language: en\r";<br />
sPacket+="Content-Type: multipart/form-data; boundary=" + CString(HTML_BOUNDARY)+"\r";<br />
sPacket+="Connection: Keep-Alive\r";<br />
str.Format("Content-Length: %d\r",sContent.GetLength());<br />
sPacket+=str; <br />
<br />
pFile->SendRequest(sPacket,(LPVOID)(LPCTSTR)sContent,sContent.GetLength());<br />
char szData[200];<br />
int iRead=0;<br />
while((iRead=pFile->Read(szData,200))>0)<br />
{<br />
szData[iRead]=NULL;<br />
TRACE("Read back is %s\n",szData);<br />
m_eRec+=szData;<br />
<br />
} <br />
UpdateData(FALSE);<br />
<br />
pFile->Close();<br />
http->Close();
Has anybody done this before using multipart/form-data.
|
|
|
|
|
Try this code:
CInternetSession session;<br />
CHttpConnection *http=session.GetHttpConnection("127.0.0.1");<br />
CHttpFile *pFile=http->OpenRequest(CHttpConnection::HTTP_VERB_POST,"/scripts/uploadf.cgi",NULL,NULL,NULL,"HTTP /1.0",INTERNET_FLAG_RELOAD);<br />
CString sContent;<br />
sContent= CString("--7d3335262f08b6")+"\r\nContent-Disposition: form-data; name=\"uploadfile\" filename=\"c:\\dccard.xml\"\r\n\r\n";<br />
sContent+=szXMLDocument;<br />
CString sEnding="\r\n"+CString("--7d3335262f08b6--")+"\r\n";<br />
sContent+=sEnding;<br />
CString sPacket;<br />
CString str_data; <br />
sPacket="Accept: */*\rAccept-Language: en\r\n";<br />
sPacket+="Content-Type: multipart/form-data; boundary=" + CString("7d3335262f08b6")+"\r\n";<br />
sPacket+="Connection: Keep-Alive\r\n";<br />
str_data.Format("Content-Length: %d\r\n\r\n",sContent.GetLength());<br />
sPacket+=str_data; <br />
pFile->SendRequest(sPacket,(LPVOID)(LPCTSTR)sContent,sContent.GetLength());<br />
pFile->Close();<br />
http->Close();
|
|
|
|
|
|
can somebody tell me how too trace that and user logon in or not?
use com, api or...
|
|
|
|
|