|
I found the reason for the problem -> There was an unresolvable ambiguity (the compiler couldn't tell which base class to override. Here's what Stroustrup has to say about this issue (see page 5).
http://www-plan.cs.colorado.edu/diwan/class-papers/mi.pdf[^]
Thanks for your responses. I must admit, I'm curious how you all got it to work.
To solve the problem, I ended up writing a wrapper class... please excuse my sad attempt at ASCII art, but here's the UML behind how I solved it.
----------- -----------
| Class A | | Class B |
----------- -----------
/\ /\
-- --
| |
| |
----------- -------------
| MyClass |_________/\| MyWrapper |
----------- \/-------------
|
|
|
|
|
Hi
I have created an app which loads DLL at runtime. I got a bizzare situation where ai need to constrain the app load time to 6 seconds. I could able to load the app within 6 seconds but mot on the first initial load. The initial load that is when you boot the system and try to run the app it takes more than 14 seconds. Is there any solution for this.
Thanks,
Vasu
|
|
|
|
|
can Delay Loading your DLL help ? see this[^].
This signature was proudly tested on animals.
|
|
|
|
|
Thanks for the reply.
I did lot experimensts using delay load rebasing dlls and found the initial load time kept increased. I found that its because of the windows NT Memory Management. I found this article very usefull which gives a detailed story about rebasing
http://msdn.microsoft.com/en-us/library/ms810432.aspx
Thanks
Vasudevan.S
|
|
|
|
|
Hello Team,
I have downloaded a freeware, that has one main_exe and one main_dll. now I wannt to write my own dll and would like to attach that the main_exe/main_dll. is there any way i can inject my dll into another dll, or attach my dll into another dll, if I dont have the source code of main_dll?
Thank you
glamakid
|
|
|
|
|
haiimran wrote: is there any way i can inject my dll into another dll, or attach my dll into another dll, if I dont have the source code of main_dll?
No there isn't. And even if it was possible you cannot get info here [^]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Who's the lardass that voted you down here?! I had to balance it.
|
|
|
|
|
Thanks.
My favourite troll is a bit angry because he's hungry... I've forgot his dish today.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I want to share some data (int var) between two application app0 and app1.
The app0 calls app1 thrugh a CreateProcess, being one of the parameters a string containing the memory address of the data which I want to share (strVar = & var).
However when I assign the addres of var to a new pointer in app1 (int * pvar1), although they point to the same memory address (pvar1 == & var), the variables are not the same (*pvar1 != var). Instead, what I obtain in *pvar1 is a very high number which I assume is an error.
Should this operation work or the fail is what you would expect in this kind of botch?
Thank you and kind regards
JMGIC
|
|
|
|
|
JMGIC wrote: Should this operation work
nope
sharing memory between processes is a bit more complicated[^] than that
|
|
|
|
|
OK, that is what I supposed,
thank you for the link!
|
|
|
|
|
I'd be cautious with the article - My reading of it is that it will only work if you have multiple instances of the same module / executable. That could work if you made a small DLL for both of your programs to use, but may be too much of a restriction.
Clever stuff, nonetheless.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
I would expect it to fail spectacularly.
Each process has its own address space - which may map to an address in RAM, on the harddisk, etc. So an address valid in one process is (if you're *lucky*) invalid in another. If you're *unlucky*, it is valid but wrong in the other process.
I haven't been caught directly like this, but I did save structures to a file which used pointers. Which (oddly enough) weren't valid when I loaded them back later. The lesson was learnt.
There are a few ways of coping data about.
1/ WM_COPYDATA
2/ Mapped memory file.
3/ shared data segments, but this only works between processes using the same module, and can be very bad if you don't have to use it.
On the information you've given, I'd go for (2), where you could pass a number as a parameter and that as the name of a memory mapped file.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
OK, thank you very much.
I will try to get some information about Mapped memory file.
Regards
JMGIC
|
|
|
|
|
Hi All,
We have a project of converting the VC++ application to be compatible with Vista(as Administrator as well as Standard User).
The application should run successfully as Standard User.
The application consists of around 100 EXEs(Few run as services) and 200 Dlls and Ocxs .
So,we started identifying the areas that need to taken care like Registry, Messaging(SendMessage(), PostMessage()),CreateProcess(),GlobalObjects,Impersonation).
I have gone through so many links related to Vista(Esp. UAC).
But i have not found any link that gives the information regarding the conversion of legacy applications to Vista compatible.
Please post me any such link,so that i am not going to miss anything.
Thanks in Advance.
Appu..
"Never explain yourself to anyone.
Because the person who likes you does n't need it.
And the person who dislikes you won't believe it."
|
|
|
|
|
|
Thanks Mark.
Appu..
"Never explain yourself to anyone.
Because the person who likes you does n't need it.
And the person who dislikes you won't believe it."
|
|
|
|
|
Is it possible to show a CDialogBar as a modal dialog (I mean to be blocking) ?
If it is not possible... can I let the CDialogBar to be "a part"
of a CDialog ?
Thanks a lot!
|
|
|
|
|
I have an end application (say Click.exe) which is placed on my desktop.
Now, I want to handle the Right click event of this exe itself ie.
if I right-click on the exe, I must be able to see a customized menu.
I know I don't have any control over the application Click.exe as such
because it is not yet started (ie. double-clicked).
Is this possible preferably by any VC++ way of handling events.
Any other solution like shell scripting ideas are also welcome.
Thanks in advance.
|
|
|
|
|
It's a rather brute force approach, but you could set a context menu handler (See Michael Dunn's superb shell series) for all exe, but only bother putting up for option if the file being right clicked on is called click.exe.
There are weak points to the idea - renaming, must be at least a partial admin to install shell extensions, what if the user makes a shortcut for the exe [*]?
Iain.
[*] I have a suspicion that the system resolves shortcuts for extensions for this very reason, but you'd have to check.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
|
in windows,
how do i set maximum open number of files ?
i tried to set FOPEN_MAX in stdio.h file, but it's not working....
need help....
thanks in advance...
xyz
|
|
|
|
|
override the definition of FOPEN_MAX in your code not in stdio.h
as
#deinfe FOPEN_MAX <n> //n is the value you need to set .
vineesh
|
|
|
|
|
Do you really think such a #define will be of any help?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
The actual definition of FOPEN_MAX in stdio.h
is
#define FOPEN_MAX 20
you can extend it to some limit (around 500)
The below code works fine
#include <stdio.h>
#include <windows.h>
#define FOPEN_MAX 500
FILE *stream, *stream2;
int main( void )
{
int numclosed;
int fd =3;
while (fd <= FOPEN_MAX)
{
if( (stream = fopen( "E:\\new.txt", "r" )) == NULL )
{
printf( "The file was not opened\n [%d] ",GetLastError());
getchar();
}
else
{
fd = fileno(stream);
printf( "The file was opened and fd is [%d] \n " ,fd);
}
}
numclosed = _fcloseall( );
printf( "Number of files closed by _fcloseall: %u\n", numclosed );
return 0;
}
============
vineesh
|
|
|
|