|
Hi,
InternetGetConnectedState() isn't a class, it is a function inside wininet.dll and it works fine for me. Are you using it correctly? Did you read the relevant page in the MSDN documentation?
|
|
|
|
|
Before abandoning the function, you should carefully examine the exception to understand what's happening (and, as already suggested, you may post the exception message here for getting better 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]
|
|
|
|
|
Hi All,
As u can deduce from the title, I'm using visual Studio 6.0 and i want use the Microsoft Platform SDK for some kind of project.
The main idea is that i'm new to the SDK, i download the Microsoft Platform SDK Server 2003 R2 (which is the compatible one for VS6).
I download some code from this site and when i tried to compile it, it said thjat some files were missing, such DShow.h, so i added the includes files by tools->options->directories->includes files.
now when i compile my project i've got those errors :
--------------------Configuration: LiveVideo - Win32 Debug--------------------
Compiling...
CaptureVideo.cpp
c:\documents and settings\fst-admin\bureau\prj 3 vc 6.0\source code\capturevideo.h(115) : error C2143: syntax error : missing ';' before '*'
c:\documents and settings\fst-admin\bureau\prj 3 vc 6.0\source code\capturevideo.h(115) : error C2501: 'ICaptureGraphBuilder2' : missing storage-class or type specifiers
c:\documents and settings\fst-admin\bureau\prj 3 vc 6.0\source code\capturevideo.h(115) : error C2501: 'm_pCapture' : missing storage-class or type specifiers
c:\documents and settings\fst-admin\bureau\prj 3 vc 6.0\source code\capturevideo.h(123) : error C2143: syntax error : missing ';' before '*'
c:\documents and settings\fst-admin\bureau\prj 3 vc 6.0\source code\capturevideo.h(123) : error C2501: 'ICaptureGraphBuilder2' : missing storage-class or type specifiers
c:\documents and settings\fst-admin\bureau\prj 3 vc 6.0\source code\capturevideo.h(123) : error C2501: 'm_pCaptureMoniker' : missing storage-class or type specifiers
C:\Documents and Settings\FST-Admin\Bureau\Prj 3 VC 6.0\Source code\CaptureVideo.cpp(33) : error C2065: 'm_pCapture' : undeclared identifier
...................................................................................................
Generating Code...
Error executing cl.exe.
I'm not sure if what i did was right or a big mistake, or the Microsoft Platform SDK still not recognised into my VS6.0.
So plz, some help will be appreciated.
"The Ultimate Limit Is Only Your Imagination."
modified on Wednesday, December 8, 2010 4:21 PM
|
|
|
|
|
DShow.h is in DirectShow library, and I think DirectShow is not a part of Windows SDK - 2003. Check for such a file in your SDK installed directory. I think you need to install DirectX 9.0 SDK, of which Directshow is a part, and add its include & lib paths to VS 6.0. DirectShow now comes with vista SDK and later.
|
|
|
|
|
Hi,
Yes indeed,, in fact i installed Direct X developper + SDK 2003 and SDK 2008. But when i use VS 6.0 it doesnt work but with VS 2005 it does. i think that the SDK 2003 doesnt includes all necessary files or the project i tried to compile is based on headers of not 2003. Any way, Thank you for your reply that was a nice hand help.
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
hello guys... I need to use some private function in the dll so that they might do some work for other functions that are called by original application.but im getting this error that states "illegal call of non-static member function". Here is what I am trying to do
MyDll.h
-----------
namespace MyDll
{
class MyOwnDll
{
private:
void msg();
public:
static _declspec(dllexport) double func(double a, double b);
};
}
MyDll.cpp
------------
namespace MyDll
{
void MyOwnDll::msg()
{ cout<<"The result is: ";}
void MyOwnDll::func(double a, double b)
{
msg();
cout<< a+b;
}
}
How can I do this? thnx
|
|
|
|
|
The message is clear: you cannot call an ordinary (i.e. not static ) class method that way. Declare it as static .
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]
|
|
|
|
|
See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
This has nothing to do with a DLL or functions within a DLL. A beginners book on C++ would help you immensely though.
It was ever thus, the Neophiles will always rush out and get 'The Latest Thing' at a high price and with all the inherent faults - Dalek Dave.
|
|
|
|
|
You already got your answer but I'll give you a quick explanation why you have this problem.
Declaring a class method as static means that the method is not called in the context of a specific class, meaning that it is very similar as a global function (it is not associated with a specific class instance). The difference between a static and a non-static method is that for a non-static method, an implicit paramater is passed to the method when it is called: the this parameter, which identifies which class instance is associated with the call (so, when you do something like that: myClass.myFunc() , the address of myClass is passed implicitely to the function). For a static method, this is not the case, since it is not associated with a specific class instance. So, within a static method, there's no accessible class instance which can be passed as the implicit this parameter passed to the non-static method. That's the reason why you can't call a non-static method from a static method (unless you call it on a class instance like this: myClass.myFunc() ).
|
|
|
|
|
Neat, sir.
It was ever thus, the Neophiles will always rush out and get 'The Latest Thing' at a high price and with all the inherent faults - Dalek Dave.
|
|
|
|
|
I think your explanation confuses class with an object of class , and will perhaps confuse the OP. The this parameter is a pointer to an object and does not directly identify which class is associated with the call.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
You're right, I forgot an "instance" somewhere. I fixed it.
|
|
|
|
|
When process exit, will the memory that's left undeleted be returned to OS? My application is a C++ application.
|
|
|
|
|
Yes.
And JFYI, OS always reclaims memory after the process (application) exits. If your process runs for some time and doesn't care to release unwanted memory then it won't be reclaimed by the OS and the memory "leaks".
|
|
|
|
|
If your process runs for some time and doesn't care to release unwanted memory then it won't be reclaimed by the OS and the memory "leaks".
This part of your reply is confusing, does it mean that if I allocate memory in my program but fail to release it properly during application exit / if the application has crashed / terminated from the task manager, will this allocated memory (allocated during program execution) will not be returned to the OS and result in memory leak?
Thanx in advance
|
|
|
|
|
No no. Suppose you have a code like this in your app
void main()
{
while(true)
{
int *array = new int[100];
}
}
As long as the app runs, you will have memory leak since you aren't deleting the allocated memory.
And it doesn't really matter if the app crashes or ends normally, for the OS the app has ceased to exist and it cleans up. It is your (the app's) data files, network connections etc that would encounter trouble when the app crashes.
Clear?
|
|
|
|
|
Yes, so to my understanding, all the memory allocated using new when a process is running is allocated from the process memory heap and it will be eventually reclaimed by the OS once the process terminates.. right?
|
|
|
|
|
vipin_nvk wrote: Yes, so to my understanding, all the memory allocated using new when a process is running is allocated from the process memory heap and it will be eventually reclaimed by the OS once the process terminates.. right?
Right!
It was ever thus, the Neophiles will always rush out and get 'The Latest Thing' at a high price and with all the inherent faults - Dalek Dave.
|
|
|
|
|
You could read these couple of very good essays:
Inside memory allocation[^]
Memory damage primer[^]
They aren't particularly explaining how the OS reclaims the resources after a process exits, but nevertheless they make a great read.
It was ever thus, the Neophiles will always rush out and get 'The Latest Thing' at a high price and with all the inherent faults - Dalek Dave.
|
|
|
|
|
|
vipin_nvk wrote: Thanx Rajesh
Ah, how very refreshing to see a polite member. Have a 5 vote from me.
It was ever thus, the Neophiles will always rush out and get 'The Latest Thing' at a high price and with all the inherent faults - Dalek Dave.
|
|
|
|
|
Bleedingfingers gave you the correct answer.
vipin_nvk wrote: My application is a C++ application.
The language used to build your program is irrelevant. The OS will ALWAYS take it back after your program is done!
It was ever thus, the Neophiles will always rush out and get 'The Latest Thing' at a high price and with all the inherent faults - Dalek Dave.
|
|
|
|
|
In addition to other answer, I just wantewd to say that it is very good practice to always release the memory you are using. This will reduce the risk of memory leaks you will have when the application is running (see another answer about memory leaks).
|
|
|
|
|
Even if the OS will reclaim the memory, it's no excuse not to clean up yourself.
M.
Watched code never compiles.
|
|
|
|