|
Hello ppl, i was going through Nishant's winsock tutorials and was trying them with WTL. In a simple console application, including winsock2.h works like a charm. but when i try it with WTL appwizard generated code, i get a huge list of 114 errors!!! (mostly type/macro redefinition errors). But if i change it to winsock.h, it works. i have included ws2_32.lib in my project settings also. can anyone give me a clue on this? thanks in advance.
I am using VC++ 6.0 with February 2003 platform sdk and wtl 7.0 on WinXP Pro.
-Tareq
|
|
|
|
|
Can anyone suggest the easiest way to print html documents from an ATL applications?
The computer will have Internet Explorer installed, can I use it to do all the work? And just specify the printer and document name?
Joanne;)
|
|
|
|
|
Hello Dears
I'm student. I've to make a plug-in for MS Outlook. This plug-in will take a particular date, and will delete all the attchments of the e-mails which are older than that specific date.
Kindly guide me for the task. Provide/guide me some sample code if possible. I'll be very grateful to you.
Waiting for your kind response.
Atif
Watch Your Thoughts for they will become your actions.
Watch Your Actions for they will become your habits.
Watch Your Habits for they will become your beliefs.
Watch Your Beliefs for they will determine your destiny.
|
|
|
|
|
This article[^] is a good starting point.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Hi
I have created a ATL COM dll.The component will be used in WINDOWS 2000 machines which will not have Visual Studio.What are the ATL com dlls that I have to distribute along with the COM component?Please help.
Rgds,
venkatesh
|
|
|
|
|
Distribute the ReleaseMinDepdency build and you won't need any ATL or CRT DLLs. This is the preferred way since the situation with ATL.DLL is nasty (diff builds for 9x/NT, not 100% backwards-compatible)
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
I am trying to time a function so that when the function
completes I can get information regarding how long the
function took to complete a calculation. Currently I
am using this method:
<code>
clock_t start, finish;
double solver_time;
start = clock();
finish = clock();
solver_time = (finish - start) / static_cast<double>(CLOCKS_PER_SEC);
</code>
whereby I go on to report the time to the user by appropriately
dealing with solver_time.
Now, I am finding that for fast functions, this does't accurately
give an indication of the time (ie: sometimes it says 0 sec,
sometimes it reports a fraction of a second for the same
function as I presume I am reaching the accuracy limit of
the machine.
My question is: is there a better way of doing this?
|
|
|
|
|
You'll need a timer with a resolution less than 1 second. There is GetTickCount() which returns the time in milliseconds, however its resolution isn't 1 ms, it's dependent on a hardware timer. But give it a shot.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
If you need really good timings, you can always use QueryPerformanceCounter . Not guaranteed to be implemented on all hardware/in all HALs, but I've usually found that it's available.
GetTickCount 's resolution on Windows NT/2000/XP/2003 (bleargh, that's getting worse...) is dependent on the HAL installed on your system. I seem to recall that there's some way to modify what this resolution is, but can't currently find it.
|
|
|
|
|
|
Thanks guys. Went with your suggestions - works well.
|
|
|
|
|
...instead of a dialog. I can't get it working and it's seriously pissing me off! Could someone give me some lines of code on this... or tell me if its even possible or if I'm just wasting time here...
|
|
|
|
|
Come on please anybody, I'm begging you! I'm certain someone has tried (done?) this before... please..
|
|
|
|
|
How can i make the dockable windows just like the Developer studio has?
|
|
|
|
|
|
I am using script control. when i add a procedure to the script control.if the procedure is error free then it works fine, but if there is a run-time error then a dialog box with the title "Just-In Time Debugging" and containg the option of .Net Studio that do you want to debug it. I want that this dialog box should not be displayed and i can handle this runtime error my self.
|
|
|
|
|
I download the wtl library and install it.
I open a sample project and compile it,but something is wrong like this:
d:\wtl\include\atlframe.h(274) : error C2146: syntax error : missing ';' before identifier 'lpnm'
d:\wtl\include\atlframe.h(905) : see reference to class template instantiation 'WTL::CFrameWindowImplBase<tbase,twintraits>' being compiled
d:\wtl\include\atlframe.h(274) : error C2501: 'LPNMREBARCHEVRON' : missing storage-class or type specifiers
d:\wtl\include\atlframe.h(905) : see reference to class template instantiation 'WTL::CFrameWindowImplBase<tbase,twintraits>' being compiled
d:\wtl\include\atlframe.h(274) : error C2501: 'lpnm' : missing storage-class or type specifiers
.....
can anyone help me with the problem?
thanks a lot
|
|
|
|
|
|
First of all ,thank you .
but can plz tell me where can I download the sdk?
thanks again
|
|
|
|
|
|
|
Hi! everybody:
I'm developing a ActiveX control which is a windowless, If I find something special in my class, I want to SendMessage to this ctrl and let it do something , but I can not get the window handle of this ctrl, so this ctrl also can not get this message.(I have tried AfxGetMainWnd, it doesn't work)
Does anyone has similar experience? Plesae give me some ideas, I'll appreciate
your help.
Ray
|
|
|
|
|
Hi,
As far as I know, it is not possible. Windowless ActiveX controls have no HWND by definition. Of course, COM passes RPC calls using thread message queue (in a case if the object belongs to a single-threaded appartment) but it cannot be simulated (and must not be).
The simplest way to handle it is to call a method of your control at the moment you need. The result will be exactly the same as with SendMessage - the control will process your call and return back. This will requre your caller class to hold an interface pointer to the control or provide it via a callback function.
--
Best Regards,
Andrew
|
|
|
|
|
I have a vector of integer that can have around 10,000 into it. There are cases when all the values in this vector are same. Right now i am just iterating through all the vector to find this out. Just wondering if someone can advise any better and optimistic way of doing this.
|
|
|
|
|
You can make use of a map to increment a counter for every time your data has a value.
map <int,int> g_mapData;
void insert(int val)
{
map <int,int>::iterator it;
it = g_mapData.find(val);
if ( it != g_mapData.end() ) {
it->second++;
}
else
{
g_mapData.insert(pair<int,int>(val,1));
}
}
And here is a test program
void main()
{
insert(0);
insert(10);
insert(5);
insert(0);
insert(5);
insert(0);
map<int,int>::iterator i;
for(i=g_mapData.begin();i != g_mapData.end();i++) {
cout << i->first << " , " << i->second << endl;
}
}
And the results are:
0 , 3
5 , 2
10 , 1
John
|
|
|
|