|
toxcct wrote:
however, you talk about forms
He might be a VB programmer migrating to VC++
--
Help me! I'm turning into a grapefruit!
Buzzwords!
|
|
|
|
|
See here.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi,
I am developing a marker application. Basically allows free-hand drawing with the mouse. When i draw a line, i want the window below also to visible. I am not able to create a transparent Pen for this? i tried BS_HOLLOW, but it doesn't draw at all.
hdc = CreateDC(TEXT("DISPLAY"),NULL,NULL,NULL);
lb.lbColor = rgbCurrent;
lb.lbHatch = NULL;
lb.lbStyle = BS_SOLID;
//hNewPen = CreatePen(PS_SOLID,10,rgbCurrent);
//SetROP2(hdc,R2_MERGEPEN);
hNewPen = ExtCreatePen(PS_GEOMETRIC,10,&lb,0,NULL);
//SelectObject(hdc,CreateBrushIndirect(&lb));
//SetDCBrushColor(hdc,rgbCurrent);
SelectObject(hdc,hNewPen);
MoveToEx(hdc, PrevX, PrevY, NULL);
LineTo(hdc, CurrX, CurrY);
DeleteDC(hdc);
........
Can anyone help?
Hercules
|
|
|
|
|
how can i display any string in debug window.In visual c++ 6.0
shumyla
|
|
|
|
|
With the TRACE Exmple:
int nPippo = 4;
TRACE("Numero Item = %d\n",nPippo);
You can formatted the message like CString format and add the parameter..
Too many plans make the health badly...
|
|
|
|
|
|
can the operators 'new' and 'delete' be overloaded?
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
|
Yes, new and delete operators can be overloaded.
Use the following signatures.
1.) new :- void* operator new( size_t p_stBlock );
2.) delete :- void operator delete( void* p );
Rahim Rattani
Software Engineer,
Matrix Systems (Pvt) Ltd.,
Karachi - Pakistan
|
|
|
|
|
It's slightly complicated in that you can overload operator new and operator delete but you can't overload the new and delete operators in the same sense as overloading, say '+'. The reason is that your overloaded
operator<code> new is only responsible for allocating memory, but someone must call the constructor, right? Same goes for delete, you can free memory, but someone must call the destructor. <br />
<br />
Regards<br />
Senthil<br />
_____________________________<br />
<font face="Verdana" size="1"><a href="http://blogs.wdevs.com/senthilkumar">My Blog</a> | <a href="http://www.codeproject.com/script/articles/list_articles.asp?userid=492196">My Articles</a> | <a href="http://geocities.com/win_macro">WinMacro</a></font>
|
|
|
|
|
Thank u senthil kumar! for ur answer!but i kinda didnt follow that last line you quoted!
how is it different from the other operator overloaded types?
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
Friends,
I have a CListCtrl with report style. I want to programatically select the row of that list control. The row gets selected, but sometimes i need to manually scroll down in order to see the selection. What i want is that the selected row should automatically comes up in the view and there'll be no need to manually moving the vertical scrol bar. How can i do so ??
Imtiaz
|
|
|
|
|
will CListCtrl::RedrawItems help? .....
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
I have a tree control on a dialog bar and I add some nodes into the tree bar on right clicking the tree control.
My problem is when I right click a node, the particular node is selected and immediately the selection jumps to other nodes.
It behaves very peculiarly. The right click doesnt select the actual node instead the selection jumps to other nodes.
How do i prevent this from happening.
Thanx in advance.
laiju
|
|
|
|
|
I have been working on a DLL w/ a basic CDialog. At this point, my dialog can be loaded with my testerApp and appears to work (can drag arround click buttons etc), but there appears to be something odd going on when switching to the module state.
When the my dll's CWinApp::InitInstance() is called, this is 0x101c8640. In calls to the dll's exported funcs this is 0x0012fdac (the same as my tester app). Any ideas on what I am doing wrong?
<br />
BOOL CWM_Script_DLLApp::InitInstance()<br />
{<br />
CWinApp::InitInstance();<br />
dlg = NULL;<br />
return TRUE;<br />
}<br />
<br />
extern "C" void CWM_Script_DLLApp::createDialog(void)<br />
{<br />
AFX_MANAGE_STATE(AfxGetStaticModuleState( ))<br />
if(dlg == NULL){<br />
dlg = new CTestDlg(CWnd::GetDesktopWindow(),this);
dlg->Create(CTestDlg::IDD);<br />
dlg->ShowWindow(SW_SHOW);<br />
}<br />
else{<br />
dlg->SetActiveWindow();<br />
}<br />
}<br />
<br />
void CWM_Script_DLLApp::killTestDlg(void)<br />
{<br />
dlg = NULL;<br />
}<br />
<br />
|
|
|
|
|
I'm trying to compile an app (that used to compile without problems, but recently just stopped). The errors I'm getting relate to using balloons with a tray icon. Example errors:
error C2065: 'NIIF_INFO' : undeclared identifier
error C2065: 'NIIF_ERROR' : undeclared identifier
error C2039: 'dwInfoFlags' : is not a member of '_NOTIFYICONDATAA'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\shellapi.h(500) : see declaration of '_NOTIFYICONDATAA'
Despite the latest platform sdk being installed on the system and the correct directories included the directories tab under options, VC++ still only wants to use the old include file. I've even tried including #define _WIN32_IE 0x501. Suggestions on how to get it to work? I hope its not something simple I've overlooked.
Thanks
modified 12-Jul-20 21:01pm.
|
|
|
|
|
Are the PSDK includes at the top of the list, so they get searched first ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Yeah, they're on top already.
modified 12-Jul-20 21:01pm.
|
|
|
|
|
Try adding these lines to your stdafx.h :
#define _WIN32_WINNT 0x0501
#ifndef WINVER
#define WINVER 0x0501
#endif
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Now I get thread and other API errors in addition to the other ones. I don't get what changed, it just stopped compiling without any changes I'm aware of.
modified 12-Jul-20 21:01pm.
|
|
|
|
|
In some dynamic scenarios, I'm accustomed to calling LoadLibrary and GetProcAddress to load and call a function at runtime. However, in those cases the function pointer is defined in my code that specifies the function's signature. What if I don't know the signature?
Let's say I don't know the DLL and function name until runtime. Obviously, I can call the GetProcAddress as it simply requires a FARPROC address. However, how will I be able to call the function and pass params to it at this point?
One possibility is directly controlling the stack in code since I can't define what I want in code and have the compiler do that for me. Any ideas?
Cheers,
Tom Archer - Archer Consulting Group
"So look up ahead at times to come, despair is not for us. We have a world and more to see, while this remains behind." - James N. Rowe
|
|
|
|
|
Tom Archer wrote:
Let's say I don't know the DLL and function name until runtime. Obviously, I can call the GetProcAddress as it simply requires a FARPROC address. However, how will I be able to call the function and pass params to it at this point?
Do you know the number and types of parameters the function takes?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
The DLL name, function name and parameter and return info are all passed to me via XML elements.
Cheers,
Tom Archer - Archer Consulting Group
"So look up ahead at times to come, despair is not for us. We have a world and more to see, while this remains behind." - James N. Rowe
|
|
|
|
|
Here goes..
//define your func
typedef DWORD (__stdcall *pFunction)(DWORD, DWORD, etc etc);
pFunction MyruntimeFunc;
//call it
int execute(char * runtimelib, char *runtimefunc)
{
char *TmpPtrToRuntimeFunc,MyRuntimeLib[150] ;
strcpy(MyRuntimeLib,runtimelib);
TmpPtrToRuntimeFunc=runtimefunc;
hLib = LoadLibrary(MyRuntimeLib);
if(hLib)
{
MyruntimeFunc = (pFunction)GetProcAddress(hLib,TmpPtrToRuntimeFunc);
if(MyruntimeFunc)
{
MyruntimeFunc(Param1,param2....);
return 0;
}
}
return -1;
}
//Hope it helps
|
|
|
|
|
I think this is not exactly what he is looking for (if I understood it well). The number and types of arguments are only known at runtime thus it is not possible to use a typedef for the function...
|
|
|
|