|
Stdafx.h usually is a good place. In general, it should be treaded as any other include file - you put right before the code that uses it.
the actual
#import "myvbcode.dll"
is substituted at compile time for
#include "myvbcode.tlh"
#include "myvbcode.tli"
|
|
|
|
|
Hi all,
I need to get the IWebBrowser2 interface from the HWND for an IE control. Currently I am using Active Accessibility to get the IHTMLDocument2 interface from an HWND.
Normally you can get the IWebBrowser2 interface from IHTMLDocument2 by querying IHTMLDocument2 for the IServiceProvider interface, then calling QueryService to get the IWebBrowser2 interface. This does not appear to work going through active accessibility. I believe this problem may have something to do with the set of objects that are marshalled with active accessibility.
If anyone has been able to successfully go from an HWND for an IE control to the IWebBrowser2 interface, I would really appreciate your help and solution.
Thank you
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hi
I'm desperately searching for a program who can create setups.
All utils i've found until now who can do that, are with annoying company screens or with limitations (if you want to change this, get the professional edition .. arghhh) etc.
Anyone found a very good one? or made one on its own?
Let me know;
Greetings
Jens
|
|
|
|
|
Do you mean that you do not want to pay for Wise or InstallShield and you are looking for freeware?
There is free version of setup which comes with VS.Net , the problem is it does not have fancy UI and you really have to understand Installer SDK (available for free from Microsoft)
|
|
|
|
|
Do you mean that you do not want to pay for Wise or InstallShield and you are looking for freeware?
indeed, i have no desire to pay for a program who makes a setup.
Don't need a fancy user interface, just the regular setup.
|
|
|
|
|
|
it does not support win installer
|
|
|
|
|
I dont think any of the free ones do and I believe that is a very good thing!! I have an application problem with the update for MSDE that everytime I reboot the pc it wants to reinstall MSDE. The thing is that it is fully installed and works fine...
John
|
|
|
|
|
I use NSIS from Nullsoft, the creators of Winamp 2.x. Winamp uses NSIS, CDex uses it and many other programs. What I like about NSIS is, that it is open-source, free and has a small scripting language
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
edit - screwed up the link - edit
Little Setup Builder[^]
Completely free and works very well.... a least for me.
...
|
|
|
|
|
I would go with John M. Drescher suggestion (InnoSetup), which is very simple to use.
Also Windows has an installer and this is the website [^].
Also, check your Visual Studio CDs because it has InstallShield somewhere, and there is also a tutorial on how to use it here in CodeProject.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
first of all .. thank you guys for the fast reply
I worked with the InnoSetup program. The program was exactly what i was searching for. Nice done!
Greetings
Jens
|
|
|
|
|
hey guys, i've seem to have one problem with 'InnoSetup'.
I've added to script that install has to make a desktop shortcut. After install, i open the shortcut. The program launches.
But then i get an error (error opening database file).
'Can not find c:\..\desktop\....db' file
The program searches in the directory where the shortcut is made!
It needs to search the database file in the same directory where the program executable really is (not where the shortcut is).
The same happens when i open the shortcut on start-menu. It searches the database files where the start menu group is located at.
The strange this is .. if i make a shortcut from my program to the desktop, i don't get this error and program is executed correctly.
Anyone who can fix this problem?
Greetings
Jens
|
|
|
|
|
I need to see the packets that pass my computer and filter out certain ones by ip address and port and data size, and then i have to stop them from arriving to the application they were meant for, how on earth can i do this???? There must be a way.. like hooking?? But i'm not sure..
All i ever hooked was the keyboard input so.. i'm not an expert on it.
I just need to know if its possible, and how (like the hooking). Most firewalls can block a given ip or port so they must use some similar technique, anyone know what it is?
Thank you
Kuniva
--------------------------------------------
|
|
|
|
|
firewall applications like ZoneAlarm generally use:
1) an TDI filter driver (WinDDK)
2) service to communicate with driver(VC++ 6.0)
3) user interface
Hush,hush...
thought I heard you call my name now.
Kula Shaker.
Amit Dey
Latest articles at CP - Writing Word addins
Office addin
|
|
|
|
|
Thanks, now at least i know what i'm up against
Kuniva
--------------------------------------------
|
|
|
|
|
|
Hello,
I was wondering if I spawned 50 UI threads in a loop if 2 of the threads started with the same thread ID would this cause the one of the threads to deadlock? I was doing some testing and it looked like 2 of the threads spawned with the same ID. Is this normal or just a fluke? Maybe one of the threads exited before the one with the same ID started, I didn't check that so it's a possibility..
The reason I'm asking is I was going to use the thread ID as a unique identifier but if 2 or more spawn with the same ID this will mess up my logic.
Thanks,
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
I don't believe it is possible for an application to spawn two threads with the same id unless a hardware or software bug caused an intermittent failure.
John
|
|
|
|
|
Thanks for your help.
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
The only way this could be possible is if one thread terminated before the other began. One possibility is to create all the threads suspended. (I'd also use the handle as the unique identifier--it's so useful for other things while the thread ID isn't.)
(Another problem is running 50 UI threads. I'd reexamine your logic there.)
|
|
|
|
|
Thanks, I just said 50 UI threads to help the example make sense.. I dont really spawn that many threads.
Thanks for the reply
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
how can I check to see if I set the processaffinity correctly?
|
|
|
|
|
Hi
The function is declared as
BOOL SetProcessAffinityMask(HANDLE hProcess, DWORD_PTR dw ProcessAffinityMask)
the return value ist nonzero if the function succeeds, if the ret-val zero call GetLastError().
An other way is:
1) call SetProcessAffinityMask(...)
2) call GetProcessAffinityMask(ProcessHandle[in], ProcessAffinityMask[out], SystemAffinityMask[out])
3) verify your set_mask with the get_mask
Regards
Frank
|
|
|
|
|
Take a look at the C++ program below, how could I produce a story from the 20 random "nonsense" sentences using the second noun of the first sentence as the first noun in the second sentence ( i.e. --> 1. The cat ran over the boy. 2. Some boy jumped into any town. 3. Any town went under some mouse. )
//Random generator of "nonsense" sentences & story
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <cctype>
using std::cout;
using std::endl;
using namespace std;
const int SIZE = 1000;
//Function Prototypes
int displayMenu();
void displaySentences();
void displayStory();
int main()
{
//Declare variables for menu
int menuChoice = 0;
//display menu and get choice
menuChoice = displayMenu();
while (menuChoice != 0)
{
if (menuChoice == 1)
displaySentences();
else if (menuChoice == 2)
displayStory();
else
cout << "Invalid menu choice" << endl;
cout << endl << endl;
//end ifs
menuChoice = displayMenu();
} //end while
return 0; // indicates successful termination
} // end main
//******** End of Program defined Functions ************
int displayMenu()
{
//declare variables
int choice = 0;
//display options
cout << "Options:" << endl << endl;
cout << "0 Exit Program" << endl;
cout << "1 Display Sentences" << endl;
cout << "2 Display Story" << endl;
cout << endl;
cout << "Enter menu option: ";
cin >> choice;
cin.ignore(1); //consume Enter key
return choice;
} //end of displayMenu function
void displaySentences()
{
//initialize article array
const char *article[5] =
{ "the", "a", "one", "some", "any" };
//initialize noun array
const char *noun[10] =
{ "boy", "girl", "dog", "town", "car", "man", "woman", "cat", "mouse", "boat" };
//initialize verb array
const char *verb[5] =
{ "drove", "jumped", "ran", "walked", "skipped" };
//initialize preposition array
const char *preposition[5] =
{ "to", "from", "over", "under", "on" };
//to hold the sentence
char sentence[ SIZE ] = "";
// loop through and make 20 random sentences out of the given array
for ( int v = 1; v <= 20; ++v )
{
// uses function strcat to concatenate random sentences
strcat( sentence, article[ rand() % 5 ] );
strcat( sentence, " " );
strcat( sentence, noun[ rand() % 10 ] );
strcat( sentence, " " );
strcat( sentence, verb[ rand() % 5 ] );
strcat( sentence, " " );
strcat( sentence, preposition[ rand() % 5 ] );
strcat( sentence, " " );
strcat( sentence, article[ rand() % 5 ] );
strcat( sentence, " " );
strcat( sentence, noun[ rand() % 10 ] );
// print the current sentence
cout << static_cast< char > ( toupper( sentence[ 0 ] ) )
<< &sentence[ 1 ] << ".\n";
// reset the sentence
sentence[ 0 ] = '\0';
} // end for loop
cout << endl;
} // displaySentences function
void displayStory()
{
//initialize article array
const char *article[5] =
{ "the", "a", "one", "some", "any" };
//initialize noun array
const char *noun[10] =
{ "boy", "girl", "dog", "town", "car", "man", "woman", "cat", "mouse", "boat" };
//initialize verb array
const char *verb[5] =
{ "drove", "jumped", "ran", "walked", "skipped" };
//initialize preposition array
const char *preposition[5] =
{ "to", "from", "over", "under", "on" };
//to hold the sentence
char sentence[ SIZE ] = "";
// loop through and make 20 random sentences out of the given array
for ( int v = 0; v <= 20; ++v )
{
// uses function strcat to concatenate random sentences
strcat( sentence, article[ rand() % 5 ] );
strcat( sentence, " " );
strcat( sentence, noun[ rand() % 10 ] );
strcat( sentence, " " );
strcat( sentence, verb[ rand() % 5 ] );
strcat( sentence, " " );
strcat( sentence, preposition[ rand() % 5 ] );
strcat( sentence, " " );
strcat( sentence, article[ rand() % 5 ] );
strcat( sentence, " " );
strcat( sentence, noun[ rand() % 10 ] );
// print the current sentence
cout << static_cast< char > ( toupper( sentence[ 0 ] ) )
<< &sentence[ 1 ] << ".\n";
// reset the sentence
sentence[ 0 ] = '\0';
} // end for loop
cout << endl;
} // end displayStory function
tincup23
|
|
|
|
|