|
On a button? As the background? Where do you want the picture rendered?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi,
I want it to be displayed at one corner of my Dialog box.
Thanks,
Deepak Samuel.
|
|
|
|
|
insert WebBrowser control in the Dialog box and load the gif in it
were rgrtgrtvrtrt rtrtb brt tyuhjghj hbhbnh hnjm 1234567?
|
|
|
|
|
Hi
I have a class called Node which is derived from CButton
now I want have associated a property sheet with it. depending on the Node windowtext I want to set the values in list boxes of all the pages related to the property sheet. How do I do it?
I believe i will attain it through overriding the OnInitDialog of the pages associated with the sheet but since these vary I cannot simply add data to the lists. How do I do it??
can somebody guide me.
Thanks in advance.
|
|
|
|
|
Not sure I quite understand what you're trying to do.. but...
why not give Node a constructor or member function that takes a pointer to a CListBox (or CListCtrl or whichever you are using) and store the pointer as a member in Node. Then the Node class can handle its own click (ClassWizard lets you do this - otherwise I forget the exact handler function) and that can access the proprety page in whatever way you like.
Remember, even if you win the rat race, you're still a rat.
|
|
|
|
|
I was trying to upgrade a C++/MFC project from VS6 to VS.NET 2003 and hit a linker problem that I cannot explain. Can one of you?
I was expecting the MFC linkage to occur to MFC7x, but the linkage fails with linker error "cannot find mfc42d.dll". I understand that the linker cannot find that dll (it's nowhere in the library search patch), but why does it look for it in the first place? How is the desired MFC version adjusted or determined?
There is no reference in the project preferences to that dll, or to anything else that looks remotely like "mfc42". I am building a DLL, which itself links to several DLLs via import libraries. These other DLLs are linked to MFC42, would that require the primary DLL to be linked to MFC42 as well?
Any thoughts are welcome.
TIA,
Bernd
|
|
|
|
|
Somewhere in your project is code that is still compiled for VC6. You will need to recompile everything to remove all references to MFC42D.dll. Also note that this is the debug version of the DLL.
Software Zen: delete this;
|
|
|
|
|
Thanks. The project itself has been cleaned and re-built at no avail.
You didn't mention the import libraries, but I believe these should not cause the problem anyhow. How about function libraries, thought?
Surely these must be rebuilt for MFC7, too? Hmm, that's like opening a can of worms.
I guess I can not link the application to both MFC42 and MFC71 at the same time, right?
|
|
|
|
|
The source of the problem can be in any piece that's referenced in the linking process: object files in your project, import libraries, or 'function' libraries.
You've rebuilt your entire project under VS.NET, so the object files in your project should not be the problem.
Import libraries are object libraries that contain stub functions that correspond to the actual functions in a DLL. These stub functions take care of loading the library and then calling the actual DLL function for you. An import library is associated with a specific DLL. If you link to an import library that was compiled under VC6, you will need the MFC42* DLL's.
By 'function' libraries, I assume you mean object libraries. If any of these object libraries were compiled under VC6, you will probably also need the MFC42* DLL's.
berndg wrote:
I guess I can not link the application to both MFC42 and MFC71 at the same time, right?
I don't believe so. You would have two different copies of MFC loaded, with the corresponding mix of state information. I doubt this would work well, if at all.
Software Zen: delete this;
|
|
|
|
|
Two words for you:
static link!
But as you (and others) have said, *everything* will need to be rebuilt with MFC 7.0 or you will have problems. This includes any supporting static libraries your project uses.
Remember, even if you win the rat race, you're still a rat.
|
|
|
|
|
Idea:
to compensate font change by inverse change of CDialog's font,
to make controls look same.
It wors for modeLess Creation,
but for Modal - ActiveX - in my case Windowless
ActiveX- do not created after ew template use.
Where is error or bot made some work?
Private members get in Macro defining CDialog function,
that called GetDoModalData() to get Them,
Functionality of creation Cdialog with font change
placed in inheritable class
class CDlgHead : public CBitmapDialog , public CDialogCreatorHelper <cdlghead>//CDialog
All works except for ActiveX-Windowless - as I tested:
<br />
CDlgHead dlg;<br />
dlg.GetDoModalData();<br />
dlg.Create_WithFont(IDD_Form_1,pParent,0,-1);<br />
<br />
class CDlgHead : public CBitmapDialog , public CDialogCreatorHelper <CDlgHead>
{<br />
<br />
public:<br />
<br />
DEFINE_DoModalData;<br />
}<br />
<br />
<br />
#define DEFINE_DoModalData \<br />
virtual void GetDoModalData() { \<br />
pCopy_m_lpszTemplateName = &m_lpszTemplateName; \<br />
pCopy_m_hDialogTemplate = &m_hDialogTemplate; \<br />
pCopy_m_lpDialogTemplate = &m_lpDialogTemplate; \<br />
pCopy_m_nIDHelp = &m_nIDHelp; \<br />
pCopy_m_pParentWnd = &m_pParentWnd; \<br />
pCopy_m_hWndTop = &m_hWndTop; \<br />
};<br />
<br />
class CDoModalData <br />
{<br />
public:<br />
CDoModalData()<br />
{<br />
};<br />
<br />
LPCTSTR* pCopy_m_lpszTemplateName; <br />
HGLOBAL* pCopy_m_hDialogTemplate; <br />
LPCDLGTEMPLATE* pCopy_m_lpDialogTemplate; <br />
UINT* pCopy_m_nIDHelp; <br />
CWnd** pCopy_m_pParentWnd;<br />
HWND* pCopy_m_hWndTop ;<br />
<br />
virtual void GetDoModalData()=0; <br />
};<br />
<br />
<br />
<br />
<br />
template <class dlg_T><br />
class CDialogCreatorHelper :public CDoModalData <br />
{<br />
public:<br />
CDialogCreatorHelper(void)<br />
{ <br />
};<br />
~CDialogCreatorHelper(void){};<br />
<br />
virtual void GetDoModalData() =0 ;<br />
<br />
CString m_FontName;<br />
int m_FontSize;<br />
<br />
<br />
int SetFont_OnHelper( int size, CString FontName = "Tahoma")<br />
{<br />
m_FontName = FontName ;<br />
m_FontSize = size;<br />
};<br />
<br />
int Create_WithFont(int IDD, CWnd* pParentWnd, int isModal, int size = -1, CString FontName = "" )
{<br />
<br />
int sys_FontSize= <br />
GetDeviceCaps(::GetDC(0), LOGPIXELSY ); <br />
<br />
if(size == -1)<br />
{<br />
<br />
if(sys_FontSize == 96)<br />
{<br />
size =10;<br />
}<br />
else<br />
if(sys_FontSize == 120)<br />
{<br />
size =8;<br />
}<br />
else<br />
{<br />
ASSERT(0);
size =8;<br />
}<br />
<br />
} <br />
<br />
if(1)<br />
{<br />
LPSTR lpszTemplateName = <br />
MAKEINTRESOURCE(IDD);<br />
<br />
ASSERT(IS_INTRESOURCE(lpszTemplateName) ||<br />
AfxIsValidString(lpszTemplateName));<br />
<br />
*pCopy_m_lpszTemplateName = lpszTemplateName;<br />
<br />
if (IS_INTRESOURCE(*pCopy_m_lpszTemplateName) && *pCopy_m_nIDHelp == 0)<br />
<br />
*pCopy_m_nIDHelp= LOWORD((DWORD_PTR)*pCopy_m_lpszTemplateName);<br />
<br />
<br />
HINSTANCE hInst = AfxFindResourceHandle(lpszTemplateName, RT_DIALOG);<br />
HRSRC hResource = ::FindResource(hInst, lpszTemplateName, RT_DIALOG);<br />
HGLOBAL hTemplate = LoadResource(hInst, hResource);<br />
<br />
HGLOBAL hDialogTemplate = hTemplate;<br />
<br />
ASSERT(hDialogTemplate != NULL);<br />
<br />
LPCDLGTEMPLATE lpDialogTemplate = (LPCDLGTEMPLATE)LockResource(hDialogTemplate);<br />
CDialogTemplate dlgTemp(lpDialogTemplate);<br />
<br />
WORD w_size = size;<br />
dlgTemp.GetFont(FontName, w_size);<br />
<br />
dlgTemp.SetFont(FontName,size);<br />
hTemplate = dlgTemp.m_hTemplate;
<br />
<br />
<br />
BOOL bResult =0;<br />
<br />
if(!isModal)<br />
{<br />
bResult = <br />
((dlg_T*)this)->CreateIndirect(hTemplate );<br />
}<br />
else<br />
{<br />
<br />
*pCopy_m_lpszTemplateName = NULL;<br />
*pCopy_m_hDialogTemplate = hTemplate;<br />
bResult = <br />
((dlg_T*)this)->DoModal();<br />
<br />
<br />
}<br />
<br />
UnlockResource(hDialogTemplate);<br />
<br />
<br />
FreeResource(hTemplate);<br />
<br />
return bResult; <br />
<br />
}<br />
CDialogTemplate dlt;<br />
int nResult;<br />
<br />
if (!dlt.Load(MAKEINTRESOURCE(IDD))) return -1;<br />
<br />
<br />
dlt.SetFont(FontName, size); <br />
LPSTR pdata = (LPSTR)GlobalLock(dlt.m_hTemplate);<br />
<br />
<br />
*pCopy_m_lpszTemplateName = NULL;<br />
<br />
HINSTANCE hInst = AfxFindResourceHandle(MAKEINTRESOURCE(IDD), RT_DIALOG);<br />
<br />
BOOL bResult ;<br />
<br />
<br />
<br />
*pCopy_m_hDialogTemplate = dlt.m_hTemplate;<br />
<br />
<br />
<br />
if(isModal) <br />
{<br />
nResult = <br />
((dlg_T*)this)-><br />
DoModal();<br />
}<br />
else<br />
{<br />
bResult = <br />
((dlg_T*)this)-><br />
CreateIndirect( dlt.m_hTemplate, pParentWnd);<br />
}<br />
<br />
<br />
<br />
GlobalUnlock(dlt.m_hTemplate);<br />
<br />
<br />
<br />
return bResult; <br />
<br />
};<br />
<br />
<br />
<br />
};<br />
<br />
|
|
|
|
|
hai all
i have an executable file installed in my system and what i need to do is
invoke that application(.exe file) when ever my operating system is up.please
help me
thank you
|
|
|
|
|
You could place a shortcut to the file in the Startup folder on the start menu, or better still, create an entry in the RUN section in your registry key path:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
This will work on whoever logs into the machine assuming they have access rights to the file that you want to run.
"You know "that look" women get when they want sex? Me neither."
--Steve Martin
|
|
|
|
|
There are multiple Run sections...
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run will execute the application before anyone logs into the system
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run will execute the application when that user (the current one) logs in...
Just make a new String Value (REG_SZ) and give it a descriptive name "My Application" then set the value of the String to the location of the executible C:\.....\somthing.exe
-=[ QuieT Cha0s ]=-
|
|
|
|
|
Is there any way i can get all the table names of a database in Access or SQL progmatically??
|
|
|
|
|
Yes. If you're using OLE-DB or ADO you can use OpenSchema to give you a schema rowset, if you're using ODBC you can use SQLTables...
Steve S
|
|
|
|
|
This will get all tables from access or any other
_ConnectionPtr pCon;
_RecordsetPtr pRs;
_bstr_t bstrTableType("TABLE");
_variant_t varCriteria[4];
varCriteria[0].vt = VT_EMPTY;
varCriteria[1].vt = VT_EMPTY;
varCriteria[2].vt = VT_BSTR;
varCriteria[2].bstrVal = mytable;
VARIANT varData;
SAFEARRAY FAR* psa;
SAFEARRAYBOUND rgsabound[1];
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = 4;
psa = SafeArrayCreate(VT_VARIANT, 1, rgsabound);
for( long lIndex = 0 ; lIndex < 4 ;lIndex++)
{
SafeArrayPutElement(psa, &lIndex,&varCriteria[lIndex]);
}
varData.vt = VT_VARIANT | VT_ARRAY;
V_ARRAY(&varData) = psa;
try
{
TESTHR(pCon.CreateInstance(__uuidof(Connection)));
TESTHR(pCon->Open(,"","",NULL));
pRs = pCon->OpenSchema(adSchemaTables);
while(!pRs->EndOfFile)
{
_bstr_t bsTableName = pRs->Fields->GetItem("TABLE_NAME")->Value;
pRs->MoveNext();
}
pRs->Close();
pCon->Close();
}
catch(_com_error e)
{
HandleComError(e);
}
Hope it helps
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
For Microsoft SQL, use the sp_tables_ex stored procedure.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
VARIANT v;
v.vt = VT_BOOL;
v.boolVal = 0;
Maybe this will work? You're initialisation of the VARIANT is not correct. If you want to place a boolean in your VARIANT, then set the type to VT_BOOL.
Er zit een korstje op mijn aars.
|
|
|
|
|
I tried with VT_BOOL.. still it doesnt work...
Also I tried declaring a function with same signature and that function call works but the one i am trying doesnt.....
Can u please tell me what can be the problem...
I am stuck from last 6 hours on this
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Two things. Firstly, you aren't initializing the variant properly, you've said it's a variant, but set the boolVal member.
Did you mean
vart.vt = VT_BOOL;
vart.boolVal = 0;
You don't specify which file/line the error occurs on. The message implies you are performing some kind of
dest = src;
where src is a VARIANT thing. If this is the case, you might be trying to assign the variant rather than one of it's union members.
Steve S
|
|
|
|
|
Hi Steve,
Yes I meant doing ---
vart.vt = VT_BOOL;
vart.boolVal = 0;
But even after doing that the error persists.
The error occurs at --
c.MemberFunc("hello", vart);
call
I know abt dest = src;
But steve I also tried writing another function with the same signature as
MemberFunc(...);
and passesd same parameters [ ie. NewFunc("hello", vart); ]
But the compiler gives no error for this call.
I am really confused
Help me out
modified 21-Apr-21 21:01pm.
|
|
|
|
|
I'm not exactely sure what the problem is, but perhaps you haven't initialised your VARIANT using 'VariantInit'. Don't know for sure if this is necessary though.
Er zit een korstje op mijn aars.
|
|
|
|
|
Hi, I've created an app which is using the CHtmlView.
When i create (from html)a window or html-dialog that covers part of the main CHtmlView and then closed - this region is not being re-painted.
I am trapping OnEraseBkgnd() which is notifying me that part of my background has been erased, but i don't know what to call to cause the RePaint.
I have tried InvalidateRect but this seems to blank the page completely.
Your help would be much appreciated
Carl
|
|
|
|
|
InvalidateRect is only half the process. This call tells Windows that a portion of the window should be repainted the next time a WM_PAINT message is sent to the window. In order to force an immediate repaint after one of the Invalidate* calls, you need to call UpdateWindow() .
Software Zen: delete this;
|
|
|
|