|
Opengl comes default with visual studio and platform SDK installations. No need to install seperately.
|
|
|
|
|
Hi Friends,
My application crashes with an error saying "Demo Application pk/si component has stopped working". The systems Event Viewer log shows an error with the following details.
"Faulting application Demo.exe, version 1.0.0.1, faulting module OLEACC.dll,version 4.2.5406.0, time stamp 0x4549bd93,exception code 0xc0000005,fault offset 0x00004062,process id 0x154c,application start time 0x01c9ee94aab4c550"
I am using Windows Vista Home Premium edition and the application which i created was a Vc++ SDI application.
Please let me know if anyone have come across this issue and what could be the possible solution for the same.
Thanks in Advance
Shanmuganathan.S
|
|
|
|
|
I am using following code for media player play/pause operation
HWND mpHandle = ::FindWindow(_T("WMPlayerApp"), _T("Windows Media Player"));
if(mpHandle)
{
::SetForegroundWindow(mpHandle);
::SendMessage(mpHandle, 0x0111, 0x00004978, 0x00000000);//Play/Pause
}
By the above code, if windows media player is playing then pause the player otherwise play.
How can I get the status of media player whether it is running or it is paused?
|
|
|
|
|
Did you fix your problem? I also want to get the status, could you please share your solution to me ?
|
|
|
|
|
Hi.Does anyone know how to cast an SP_CLASSIMAGELIST_DATA structure to CImageList class? Is it possible? I'm guessing it should be but can't seem to be able to do it. Actually I've retrieved an imagelist of all devices using SetupDiGetClassImageList function into a SP_CLASSIMAGELIST_DATA structure. I'm now trying to set it to be the imageList of my Tree Control that lists the devices. However due to these casting issues I get a runtime assertion error and my application crashes. Any ideas?
I've tried the following methods but have failed with the same runtime error.
Method 1:
<i>PSP_CLASSIMAGELIST_DATA imageList;
SetupDiGetClassImageList(imageList);
<b>m_Tree.SetImageList((CImageList *)imageList->ImageList,TVSIL_NORMAL);</b></i>
Method 2:
<i>PSP_CLASSIMAGELIST_DATA imageList;
CImageList imList;
SetupDiGetClassImageList(imageList);
<b>imList.Attach(imageList->ImageList);
m_Tree.SetImageList(imList,TVSIL_NORMAL);</b></i>
I have bolded the lines that are causing the crash.
|
|
|
|
|
Can you show me the definition of CImageList and PSP_CLASSIMAGELIST_DATA?
|
|
|
|
|
Hey, I've added all the code relevant to retreival of ImageList below. There is nothing other than this in my code. Please have a look and let me know what modifications it would require. Thanks!
Code:
PSP_CLASSIMAGELIST_DATA imageList={0};int imIndex;
CImageList imList;
imageList->cbSize=sizeof(SP_CLASSIMAGELIST_DATA);
SetupDiGetClassImageList(imageList);
imList.Attach(imageList->ImageList);
m_Tree.SetImageList(&imList,TVSIL_NORMAL);
/*devInfo is a valid SP_DEVINFO_DATA structure.I know this because the tree control shows the correct output(without any images though)*/
SetupDiGetClassImageIndex(imageList,&devInfo.ClassGuid,&imIndex);
I later use imIndex to set the iImage property of TVITEM structure. This is node that is later inserted into the tree.
|
|
|
|
|
So,
m_Tree.SetImageList(&imList,TVSIL_NORMAL);
caused a runtime error, you said?
What kind of error you had at this time?
If you had application error like 0xc0000005, some pointer maybe invalid.
Other error, I cannot imagine the situation at this time.
|
|
|
|
|
Yes it is an application error where it refers to some address claiming the memory could not be "read". However, if that statement is commented out all seems to run fine. So all I can conclude from this is that the problem lies in these 2 code statements of Attach and SetImageList functions. I really can't figure out what could possibly be causing this and am really close to giving up on the idea of adding images! Please Help!
Exactly the error is as follows:
The instruction at "0x00405652" referenced memory at "0x00000004".The memory could not be "read".
modified on Friday, June 19, 2009 2:27 AM
|
|
|
|
|
> referenced memory at "0x00000004".
This usually means that offset 4 of pointer which points null is not accessible.
So you can check the member whether null or not of imList.
If you use visual studio IDE, you can step into codes and can check any data is null or not.
|
|
|
|
|
Hey,
I think that I've found a problem in your code. Please see the modified code below,
<br />
SP_CLASSIMAGELIST_DATA imageList = {0};<br />
int imIndex;<br />
CImageList imList;<br />
imageList.cbSize=sizeof(SP_CLASSIMAGELIST_DATA);<br />
SetupDiGetClassImageList(&imageList);<br />
imList.Attach(imageList.ImageList);<br />
m_Tree.SetImageList(&imList,TVSIL_NORMAL);<br />
Hope it helps..
|
|
|
|
|
|
If you open the dll as a "resource" in msdev or devenv then you can edit copyright information.
|
|
|
|
|
Is it a dll owned by your firm....
Beware that you are not violating the copyright norms
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Hai!
In any MFC dialog based application if we go to Resource view->and click on Version
we get a version info of our application in the version info there are two bocks :
1. FILEVERSION 1,0,0,1 and PRODUCTVERSION 1,0,0,1 etc
then a black line as separator then
2. Block header, Comments , company name and then File vesion product version etc.
Now i need to get the file version of my application programatically, i am currently using GetFileVersionInfo (), this function gets the file version fron 2nd or lower block, i need the file version from 1st block FILEVERSION, is there any direct function??
Thanks!
|
|
|
|
|
kapardhi wrote: Now i need to get the file version of my application programatically, i am currently using GetFileVersionInfo (), this function gets the file version fron 2nd or lower block, i need the file version from 1st block FILEVERSION, is there any direct function??
User GetFileVersionInfo function. For a demo have a look at the Process viewer[^] application.
|
|
|
|
|
Sorry for not providing a detailed information!
I actually want to get the version information programmatically for a Pocket PC WIN CE device, I am developing the application in eVC++
I have used GetFileVersionSize (), GetFileVersionInfo (), VerQueryValue() in Visual studio 2005, which was working but not in eVC++
Can i get version information for a PocketPC Application, because if i implement the above functions i get 1814 as error using GetLastError() after executing GetFileVersionInfo() stating "The specified resource name cannot be found in the image file." what does this mean ??
Thanks!
|
|
|
|
|
|
I currently have an application, that tracks activity for any changes in an external app. I am using windows enum to keep track of all instances of that application and open windows. In case if any user decides to have a multiple instances running. However I only get the active window first hence my process only goes after the active window, by the time it's done processing the user could have changed to the second window and I would miss any changes that have been made in the second window.
What I would like to do, not even sure if it's do able or is it beyond my level of expertise, which practically is a bigginer.
My application to be able to open a thread or something for every window thats open for the external app. Message back to my app probably using IPC, Post Window Message or some sort of communication to process the changes based on the window thats opened in the external app. In other words if 10 windows are open, have 10 different threads go after each window. Is this really how I should do it or is there a better way?
Please could someone shed some light and tell me if there is a better way to do it.
Thanks a Million.
|
|
|
|
|
sounds interesting, but what sort of monitoring are you doing of this 'external app' and why ? it sounds dangerously close to writing 'spy software' - dont get me wrong, you may have a valid reason, but if someone came to me with a request like that I'd sure as heck be asking them to validate why first and then what.
Its not 100% clear what changes "any changes in an external app" you're looking for - depending on what you're looking for you could use API hooking, for example, to track when users open files for example - you could look at the Microsoft 'detours' library for what I mean. Its also not hard to track lists of processes, windows etc and relate them - so I think you need to supply more details
Ultimately, and Im guessing you dont, but having the source and injecting log/trace points into it would be easier than watching it from the outside in ..
some links you may like to see (in addidtion to looking at MS 'Detours') :-
Detecting Windows NT/2K process execution[^]
API hooking revealed[^]
(for example)
'g'
|
|
|
|
|
Yeah, I hear your valid reason for this. The vendor has decided not to support the application. I have been against using detours or hooking as a long term solution for the sher reason of acting as a spy. The other main reason is, we have different vendors for different applications. Not sure if you can even find out, but if it is trackable that a hook is running, they could end up terminating their services in an anticipation of the hook is hooking into their system.
|
|
|
|
|
FISH786 wrote: Not sure if you can even find out, but if it is trackable that a hook is running, they could end up terminating their services in an anticipation of the hook is hooking into their system.
ok, surely though, if "The vendor has decided not to support the application " ... that gives you leeway to 'do what you must'
sounds like a yuckky situation, sorry I cant help more
'g'
|
|
|
|
|
However, am I right, a system that has been hooked is dectactable in knowing that a hook is running? I don't want to have problems with the other vendors? Could you at least answer this for me?
|
|
|
|
|
I'd say no, a program wouldnt necessarily know its being hooked - the idea of hooking is to transparently capture (& redirect) API calls for example... so to inject a hook and get it wrong would crash/corrupt the in-memory copy of your program, which is not what you want .. hence the ability for hooks to be considered malicious
'g'
|
|
|
|
|
Last question, If it's not detactable, if you were in my shoe, would you use the hook over a short period of time and get it over with without worrying about other vendors, or use the threading option and be safe with other vendors?
Which option would you choose, I can only see the hook being installed for a week or tops a month?
|
|
|
|