|
Hi there,
Can I derive a template from its template parameter?
If yes how. If no, is there another way to have similar result?
Want to have window controls that keep their behaviour but need to capture
extra messages that result in identical behaviour for all. So these specific msgs would be captured in Pretranslate of template class others would be forwarded to the base class, which would be the template parameter. I want to avoid duplicity
at all cost...
eg:
template<class wndclass=""> class CNewClass: public WndClass
{
...
};
PS the above does not compile (at least not on my PC) but gives an idea of what I`m
talking about....
Greetings,
Davy
And so it came to be, that all screens went blank and any attempt to reset failed!
|
|
|
|
|
Ok to avoid confusion in the above message
in the example i used brackets for the template parameter but when submitting that
whole part got thrown out somehow.
so my example was
template <class WndClass> class CNewClass:public WndClass
{ ... };
hope that does the trick now...
Question still stands, still don^t know any answer...
|
|
|
|
|
Hi! I am writing a browser style program and want to use the icons from the Internet Explorer toolbar. The majority of these are in shell32.dll although back, forwards, stop, refresh, and home aren't.
My question is this: Is it legal to use them? I would not be packaging the icons into my program, just loading them on the clients machine, so am I allowed to incorporate them.
If the answer to that is yes my second question is where are the back forwards etc. icons hidden and how do I extract them?
Cheers
Dom
|
|
|
|
|
blindcop wrote:
Is it legal to use them?
I *think* that as long as you don't say that you created them, that you're allowed to use them.
blindcop wrote:
I would not be packaging the icons into my program, just loading them on the clients machine, so am I allowed to incorporate them.
Does this mean that whenever a user changes the icons in shell32.dll, that the icons in your program also change? If so, then you aren't actually using *their icons*, but just a reference to it. That is allowed IMHO.
blindcop wrote:
Where are the back forwards etc. icons hidden and how do I extract them?
In explorer.exe, there are some bitmaps embedded which contain all possible icons in all states (normal & highlighted, small & big). I tought that I saw the icons that you need among those, but I'm not sure.
|
|
|
|
|
That sounds encouraging! I just had a quick dig in explorer.exe and found a few icons but not the navigation icons unfortunately. Any other ideas where they might be hidden?
Cheers
Dom
|
|
|
|
|
Daniël Pelsmaeker wrote:
In explorer.exe, there are some bitmaps embedded...
Actually, there are none, at least in version 6. There are, however, 23 icons, but none of them are arrow-related.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
blindcop wrote:
If the answer to that is yes my second question is where are the back forwards etc. icons hidden and how do I extract them?
I'm not sure if the ones used by IE are icons or bitmaps. Progman.exe has four navigational icons that might interest you. There are also several in the C:\Program Files\Microsoft Visual Studio\Common\Graphics\Icons\Arrows folder.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Thanks for that. I am really after the IE style icons/bitmaps if at all possible.
Cheers
Dom
|
|
|
|
|
You'll find them in browseui.dll.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
hi im aswin
i have the server program which runs as a windows NTservice.
when i start the service the server listen at particular port.
and the client gets connected at a particular.
i have logeed the events htat are happening
the problem is that when a client gets connected, the onaccept method is not triggered and i couldnt see the logevent in my text file.
im sending the program.i would be happy if u can help me with the problem.
Regards
Aswin N Paranji
Note:
the file path has to be set mannualy at the method
CServiceNT::Install
In the Service the display Name will be "OWn"
to install Service
C:\fmyownser\debug\myownser.exe -i
to unistall service
C:\fmyownser\debug\myownser.exe -u
incase the file didnt get attached ill send u in mail plz send ur mail id
|
|
|
|
|
Well, i can't see your code but check whether you have message loop.
If not then add the following:
MSG msg;
while (GetMessage(&msg,NULL,NULL,NULL))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
|
|
|
|
|
Hello,
I'm looking about a sample program who displays a bitmap when the application starts. (like Adobe Acrobat Reader, Microsoft Word)
I'm working with Visual Studio 6.0 and a Dialog Based application.
I can display a dialog box and close automatically it after 5 seconds but I can't display the bitmap inside this resource.
Who can help me?
Regards,
|
|
|
|
|
go to:
Project->Add To Project->Components and Controls->Visual C++ Components->Splash screen
|
|
|
|
|
I tried but it failed. A message box is displayed:
'Cannot find the main frame class.
Please confirm that this project contains a class named CMainFrame.'
After closing the messagebox, I stay on the components and controls gallery screen.
It's maybe due to my project based on dialog boxes.
I will try to create the new Class CMainFrame.
What can I do more?
|
|
|
|
|
jmi.vanye@skynet.be wrote:
I can display a dialog box and close automatically it after 5 seconds but I can't display the bitmap inside this resource.
Can't you simply make this splash-dialog a button? A button can display a bmp, and you have access to all sort of messages.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Thank you for your help.
I have found the solution into the project: Dialog Splash Demo.
a .cpp and .h files are provided and it works well.
The files are SplashWnd.cpp and SplashWnd.h.
Regards,
Jean-Michel
|
|
|
|
|
hello! I just learn c++ one week .now i am writing a program and i want to
add *.h written by me to *.cpp.firstly I select FILE-->NEW -->PROJECT-->WIN32 CONSOLE APPLICTION,and i call the projent name on the right ,then select OK,select FILE -->NEW-->FILE-->C++HEAD FILE,then name classfarm.h
-->OK,write the #include<iostream.h>
class farm_house
{....};
then select FILE-->NEW -->FILE -->C++ RESOURCE then select add the file to
the project same as the above on the right.selectOK,then write classfarm.cpp
,but unfortunately debug alway show 1 error o warning, by checking i found the error lies in the included classfarm.h which can not been included to the classfarm.cpp.
please help me ,thank you very much!
vividtang@eyou.com
|
|
|
|
|
I have find the answer ,only write "#include classfarm.h" not "#include<classfarm.h>";P
|
|
|
|
|
Hey,
Is it true that MapAndLoad() maps the .exe or .dll according to FileAlignment and not according to SectionAligment (like the loader does) ?
Thanks in advance!
|
|
|
|
|
Hi,
This is my problem:
I am using VC++ 6.0, and my program has to execute a shell application, this task is accomplished with the "ShellExecute", but my problem starts here.
For example, if the command is indefinite (ping 10.0.0.1 -t), How can I kill this process with a VC++ sentence????? without execute the manual CTRL+C
sorry for my english,
thanks in advance
|
|
|
|
|
Instead use ShellExecuteEx and get Process handle, followed with TerminateProcess....
Brian
|
|
|
|
|
Try to avoid TerminateProcess() if possible. See MSDN description of TerminateProcess for the reasoning. Solutions depend on whether the child process has a top level window or are running in a console. I'll assume the child process you describe will be running in a console.
One way is to...
1. Spawn child process with ShellExecuteEx() or CreateaProcess()
2. WaitForSingleObject(Handle_To_ChildProcessID,YourTimeOutValue)...consider putting this in worker thread
3. If times out, then kill child process
***NOTE: I have read about others getting CreateRemoteThread to work as described below but I personally have not confirmed this. CreateRemoteThread is available in NT/2K/XP. ***
- CreateRemoteThread() using the ProcessID handle you got from CreateProcess and passing the address of ExitProcess() as the lpStartupAddress. ExitProcess() appears to be mapped to the same address in each processes address space. You can obtain this address by using the address from your process.
- When the remote thread starts (and calls ExitProcess) within the child process, the child process can now "cleanly" terminate.
If the child process has a top level window, then just PostMessage(HandleToChildsWnd, WM_CLOSE, 0,0), then confirm the process terminated.
Regards
Mike
|
|
|
|
|
I create a com object using vc++.I want to return two recordsets in one call.The object has a method(Mymethod) like this
#define VS_CONNECT_1 L"Provider=SQLOLEDB;password=Pass;persist Security Info=True;User ID=User;Initial Catalog=pubs;Data Source=sqlserver;"
Mymethod(IDispatch **pRs1,IDispatch **pRs2)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
// TODO: Add your implementation code here
_RecordsetPtr pRSMems,pRS1
HRESULT hr;
try {
_bstr_t strSQL;
strSQL = "select * from authors;select * from employee";
hr = pRSMems.CreateInstance (__uuidof(Recordset));
if (FAILED(hr)) _com_raise_error (hr);
pRSMems->CursorLocation = adUseClient;
hr = pRSMems->Open(strSQL, VS_CONNECT_1, adOpenStatic,
adLockBatchOptimistic, adCmdText);
if (FAILED(hr)) _com_raise_error (hr);
pRS1 = pRSMems->Clone(adLockUnspecified);
pRSMems->putref_ActiveConnection(NULL);
*pRs1 = pRSMems.Detach();
long cnt = 0;
pRS1 = pRS1->NextRecordset((VARIANT *)cnt);
pRS1->putref_ActiveConnection(NULL);
*pRs2 = pRS1.Detach();
return S_OK;
} catch (_com_error &e) {
HRESULT hrerr = e.Error();
return hrerr;
}
}
I call it in VB
Dim obj As Object
Dim rst As Recordset
Dim i
Dim rst1 As Recordset
Set obj = CreateObject("mycom.object")
i = obj.mymethod(rst, rst1)
Do While Not rst.EOF
MsgBox rst.Fields(1)
rst.MoveNext
Loop
Do While Not rst1.EOF
MsgBox rst1.Fields(2)
rst1.MoveNext
Loop
I clone a new recordset,then put activeconnection of original recordset to null.But I fails yet.I need help.
thanks.
|
|
|
|
|
Hi,
I have an application that draws text vertically. This application uses the MM_TWIPS mapping mode.
Everything works fine except when I try to copy the text into the clipboard as a metafile. In this case, when the metafile is pasted into MS Word 2002 (XP), the metafile is pasted correctly. However, when the metafile is pasted into MS Word 2000, or into another apps such as Photoshop, the text is rotated by an additional 180º.
For example, if the text rendered in the screen is:
S
A
M
P
L
E
It's converted into
E
L
P
M
A
S
when pasted as a metafile in Office 2000 apps or photoshop.
This does not happen if the mapping mode is MM_TEXT. However, my application is strongly based on MM_TWIPS mode.
This is some sample code:
void CTestView::OnDraw(CDC* pDC)
{
// Set mapping mode
pDC->SetMapMode( MM_TWIPS );
CFont font;
LOGFONT lf;
ZeroMemory( &lf, sizeof(LOGFONT) );
lstrcpy( lf.lfFaceName, "Arial" );
lf.lfEscapement = 900;
font.CreateFontIndirect( &lf );
CFont* pOldFont = pDC->SelectObject(&font);
pDC->TextOut(1100, -1100, "Sample Vertical Text");
pDC->SelectObject(pOldFont);
}
void CTestView::OnEditCopy()
{
CMetaFileDC * m_pMetaDC = new CMetaFileDC();
//draw meta file
CClientDC clientDC(this);
OnPrepareDC(&clientDC);
m_pMetaDC->CreateEnhanced(&clientDC,NULL,NULL,"Metafile");
m_pMetaDC->m_hAttribDC = clientDC.m_hDC;
m_pMetaDC->m_bPrinting = true;
OnDraw(m_pMetaDC);
//close meta file dc and prepare for clipboard;
HENHMETAFILE hMF = m_pMetaDC->CloseEnhanced();
//copy to clipboard
OpenClipboard();
EmptyClipboard();
::SetClipboardData(CF_ENHMETAFILE,hMF);
CloseClipboard();
//DeleteMetaFile(hMF);
delete m_pMetaDC;
}
|
|
|
|
|
Hi,
I am begineer with regard MSMQ technology. I need to know if I can pass a structure via MSMQ and read it on the other side. Any suggestions regarding this will be helpful.
Regards
Arthi.
|
|
|
|