|
Hi everybody,
I am busy writing an setup program for my application. I am using some shell functions like SHGetSpecialFolderLocation to get Program files location. The problem is that this function requires a specific version of a shell dll to be present on the system. What do I do if I install the app on a older system like NT or 98 and the version of the system dll is old ? Is there a set of redistributable shell objects that will ensure the application work on all environments or is there another solution to this problem ?
Help appreciated.
Regards
Ramsus
Carpe Deum
|
|
|
|
|
Ramsus wrote:
I am using some shell functions like SHGetSpecialFolderLocation...What do I do if I install the app on a older system like NT or 98 and the version of the system dll is old ?
That function is available on Windows NT4 and later, and Windows 95 and later. Perhaps you were thinking of SHGetFolderLocation() , which did not come out until Windows 2000, and Windows Me.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hello,
I have a very strange error in my multithreaded application. The situation is as follows:
[thread 1]
I have one dialog window open, this dialog spawns 2 threads (thread 2, thread 3] when it is initialized.
[thread 2]
This thread spawns two other threads (thread 4, thread 5). After spawning those threads, it retrieves data from a buffer
The two other threads are identical and retrieve data from 2 diffenrent COMM ports and put the data in the buffer.
When data is successfully retrieved, it notifies thead 3.
Before shutting down, it notifies the monitor thread (3) and shuts down thread 4 and 5. It waits until the threads are cleaned up.
[thread 3]
Its sole purpose is to monitor thread 2 and notify the dialog when data is arrived.
This thread cleans up itself after it recieved the notification that thread 2 is stopped.
[thread 3, thread 4]
These two threads retrieve data from two different COMM ports. The retrieved data is stored in a std::vector managed by thread 2.
You may think that I have too much thread for this purpose (2 would be enough for this type of work), but this is by design. The extra monitor thread is used because this is a test application. In the real application the monitor threads do some real work.
Now for the problem. Everything works like a charm, except when I try to stop thread 2. It actually manages to stop thread 3 and 4. After that, the thread is cleaned up (the thread 2 and 3 are gone in PView thread 2 not). But then, BANG the program crashes in the middle of the following function: AfxUnlockTempMaps at the following line: pThreadState->m_pSafetyPoolBuffer = malloc(pApp->m_nSafetyPoolSize);
The error message in the output window of VS2005 is:
Unhandled exception at 0x02845922 (dbghelp.dll) in TestInput.exe: 0xC0000005: Access violation reading location 0x0152070c.
The location is always the same and no pointer is even near that address...
I noticed that the problem does not occur when thread 3 and 4 stop sending data to the buffer of thread 2. Here are some code snippets:
The call where the data is added to the buffer of thread 2
m_pConsumer->AddDataToInternalBuffer(Data);
The AddDataToInternalBuffer function
void AddDataToInternalBuffer(SERIAL_DATA& SerialData)
{
INTERNAL_LOCK();
m_InternalBuf.push_front(SerialData);
}
Does anybody have a clue what might be happening?
Blog[^]
|
|
|
|
|
I still don't know why the problem occurred, but it was in the dbghlp.dll library when the function CheckStack64 was called. This function call was made from within the Visual Leak Detector libray and without linking to that lib, everything works fine.
Blog[^]
|
|
|
|
|
how to call new dialog box(new form) by clicking a button in a current form
|
|
|
|
|
That's not really complicated. In your handler function from the button, just created the dialog and call DoModal:
void CYourMainForm::OnButton()<br />
{<br />
CYourDialog Dialog;<br />
Dialog.DoModal();<br />
}
Of course, the DoModal function will not return until the dialog has been closed.
Hope this helps
|
|
|
|
|
cedric code is right, but considering you use MFC.
however, you talk about forms, which reminds me a little about .NET framework. If so, prefer posting sich questions on Managed C++ Forum instead.
the code would be so :
void MyDialog::OnButtonClick() {
Form myForm = new Form();
myForm.ShowDialog();
}
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
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.
|
|
|
|