|
otrcomm wrote:
Have I missed something?
No I did, sorry. I just assumed that for unknown types it would display the dialog for you. You know what they say about assumptions right?
So after some digging here is what I found:
ShellExecute will return SE_ERR_NOASSOC for a file extension with no association. So under that condition you do this:
HINSTANCE hInst =
::ShellExecute(NULL, "open", "rundll32", "shell32.dll,OpenAs_RunDLL c:\\winzip.log", NULL, SW_NORMAL);
The example of course is where you tried to open the file [C:\\winzip.log]
Hope that helps
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
That did it!
Thanks man!
When I get the project finished that I am working on, I'll send you the code if you want it. It's a very fast search engine for files and 'text in files' for Windows. And if I get it together, I will also have it search a Win32 Squid Cache.
I already have the Squid Cache search engine working in a Unix environment (written in Perl), but now I want to get it working in the Windows environment.
Murrah Boswell
|
|
|
|
|
Sounds like good material for a CodeProject Article eh?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Yeah, that's where I'll post it!
I've never posted anything at CodeProject, but I guess it's high time!
Murrah
|
|
|
|
|
I have a memory blank ...
what's the name of the MFC shape drawing sample program ? where you can draw shapes (squares, circles, ... ) , select them, manipulate them, ...
I know about scribble, but it's not the one I want... ( or I have the wrong version ).
I need it to use as a prototype template.
Thanks.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
|
yes, I think that's the name, will check tomorrow .. .
Thanks!
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
ok,thing is quite simple.Why cant i manage to compile a damn program with the ms c++ 6.0???
If anybody anywhere can spare a few moments to either tell me a site with the biggest 'tutorial for
complete idiots' or just write a simple step by step
for me i'd be .....grateful.All i want is to make an executable file so dont bother with the type of wizards i want to use,just basic 'do this then do that'.thanks.
|
|
|
|
|
|
Hi.
I have an application where I use WaitForMultipleObjects()
to wait for any one ( ie) 'any of' not all ), of a number of events to become signalled. However, the maximum number of events that I can wait on in a single call to WaitForMultipleObjects is 64. I need to be able to wait on more than 64.
I know that I could create groups of 64 and loop through them with a timeout until I get one of the events signalled. But, I cannot afford the time waiting for a
timeout to occur, however small.
If anyone has an idea of how I could get around this I would appreciate the help.
James.
|
|
|
|
|
Would it be possible to have multiple threads waiting? Each thread would wait for no more than 64 events.
|
|
|
|
|
Thank you for the reply.
I had thought of that, but again I did not want to compromise the throughput speed that the application currently delivers.
But, I have been thinking about this all night and I cannot think of another solution that would 'scale' as well as your suggestion.
So, it looks like thats the road I will have to take.
Best regards.
And again, thank you for the reply.
James.
|
|
|
|
|
After much deliberation and study of my code, I have decided to abandon the idea of trying to handle more than 64 events.
It is just not possible to integrate multiple threads, each waiting on a set of 64 events.
I need to be able to maintain the current application throughput and the overhead would be too much.
The list of events that I wait on is not constant and is waited on upto 3000 times per second.
The intended user will just have to deal with the limitation.
So thats that.
|
|
|
|
|
Hi,
I have a question if there is a limitation on the number of timers that could run on a Dialog.
SetTimer method of the CWnd class is used.
|
|
|
|
|
Hi,
AFAIK (As Far As I Know) there is only a limitation within Windoze, they say there is a maximum of timer handles Windoze can handle (how poetic), but I've never heard of a limit within a dialog..?
hope it helps...
---
YOU KNOW WHAT YOU ARE BLONDIE!?!? YOU'RE JUST A SON OF A BA A A A AAAAAAAAAA!!!!!
http://sprdsoft.cmar-net.org
http://t1tan.cjb.net
|
|
|
|
|
ok let me reframe the question to how many timer handles Windoze can handle given the fact that all the "OnTimer" processing happens on a single UI thread
|
|
|
|
|
|
I see the following behavior under VC6:
template <class T> void foo()
{
printf("sizeof(..)=%i\n", sizeof(T));
}
int main(int argc, char * argv[])
{
foo<BYTE>();
foo<float>();
return 0;
}
(the real implementation is a bit more complex, it's a bit more complex, seems like at (*) VC6 chooses to call the float variant)
However, when I change the function declaration to
template <class T> void foo(T * p = NULL)
{
printf("sizeof(..)=%i\n", sizeof(T));
}
it seems to work correctly.
I know that you can't templatize functions by values, only by types - btu that the types must appear in the argument list??!!
Is this (yet another template-related) bug of VC6, or is this what the C++ Standard says?
(I'm pretty much pissed anyway, checking a few dozen templates if they need the T*=NULL trick, but I'd like to know at least if it's my ignorance or the compiler's fault)
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
must be a VC6 bug. the same code in VC7 gives the correct result.
Software | Cleek
|
|
|
|
|
Yes, VC 6 has problems when a type template parameter doesn't appear in the function's parameter list. Your dummy T* p = NULL parameter is the normal workaround.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
-- Buffy
|
|
|
|
|
|
I have been having problems trying to set up a plugin for my program. The program loads a DLL dynamically, and then calls a member function:
__declspec(dllexport) int Start(CDervDlg *dlg)
{
dlg->m_SomeVar = TRUE;
dlg->SomeFunc("Blah", "Blah");
}
I've tried using both regular DLLs and Extension DLLs, but neither work.
This is probably just something obvious that I just can't see, but can anyone help?
|
|
|
|
|
if SomeFunc is on the DLL, you have to dllexport it when generating the DLL and dllimport when generating the EXE.
If it is an MFC extension DLL, you can use the AFX_EXT_CLASS macro, for example:
class AFX_EXT_CLASS CMyDlg : public CDialog
{
};
Jaime
|
|
|
|
|
Somefunc is in the EXE.
class CDervDlg : public CDialog
{
void TestLoad();
void SomeFunc(CString, CString);
BOOL m_SomeVar;
};
typedef int (*SCGptr)(CDervDlg *);
void TestLoad()
{
HINSTANCE inst = AfxLoadLibrary("testlib.dll");
SCGptr Startfunc = (SCGptr)GetProcAddress(inst, "?Start@@YAHPAVCDervDlg@@@Z");
if (Startfunc != NULL)
Startfunc(this);
}
#include "DervDlg.h"
__declspec(dllexport) int Start(CDervDlg *dlg)
{
dlg->m_SomeVar = TRUE;
dlg->SomeFunc("Blah", "Blah");
}
Thank you for helping.
|
|
|
|
|
In DLL you have to declare:
class __declspect(dllimport) CDervDlg : public CDialog
{
void TestLoad();
void SomeFunc(CString, CString);
BOOL m_SomeVar;
};
and in EXE:
class __declspect(dllexport) CDervDlg : public CDialog
{
void TestLoad();
void SomeFunc(CString, CString);
BOOL m_SomeVar;
};
In your DLL you are using a function declared in the EXE, that's why you need to export from the EXE, and import it into the DLL.
Jaime
|
|
|
|