|
Refer "DirectShow Framework". And It was deprecated in Vista where Media Foundation, it replaces.
-- modified at 5:41 Friday 22nd June, 2007
|
|
|
|
|
|
I am creating installer for my vc++ application by compiling Windows Installer(Visual Studio Deployment) project together with my vc++ application.
When the install finish there is an icon for exe in Start Button --> All Programs menu --> Application Name. I would like to add uninstall facility also to the same place. How to do this.
Any help would be greatly appreciable.
Best Regards,
Suman
|
|
|
|
|
Hi,
You need to keep you application specific data in the following key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
Observe the keys already there in this registry path.
Hope that helps.
Kiran.
|
|
|
|
|
Hello everybody,
i need to add a new functionnality to my application.
To drag and drop a row of a grid into a opened/existing Word document.
Before i start, is it possible to do that in MFC?
If i start the drag with the mouse and i leave the mouse-button ( the drop ) on another
application, is it possible to determine in my application on which application i made the "drop" ?
Big thanks for your help
|
|
|
|
|
baerten wrote: Before i start, is it possible to do that in MFC?
Yes. MFC integrates fine with Drag'n'Drop and the Clipboard.
baerten wrote: If i start the drag with the mouse and i leave the mouse-button ( the drop ) on another
application, is it possible to determine in my application on which application i made the "drop" ?
Not usually and if you didn't write the other app it's probably not a good idea to try anyway. If you want specific content for Word then you'll have to supply that data to the Clipboard in a Word specific format.
I'm afraid I don't have quick access to any examples/samples at this moment but it's the Clipboard that mediates this kind of task so you need the works on Clipboard formats and Clipboard programming. That's how the target application actually get data from you and it will select which of the formats you make available it wants to take from the Clipboard. Office apps will take their own private formats ahead of shared/generic ones. I don't know about Word but when I last looked at this Excel supported 21 Clipboard formats
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
many thanks for your reply.
So the steps are :
* At the start of drag and drop create the text into a Word-Format
* Determine in which application the "drop" occurs (propably by finding the Process-ID )
* Store the formatted text into the clipboard
* Perform an automatic Paste into the Word-Document
In some weeks i'll start with this project, till then i'll collect more informations before
i start it...
That's a hard stuff for a MFC-Beginner i think
|
|
|
|
|
Not quite I think. It's more like :-
At the start of drag and drop create the text into a Word-Format and optionally a generic format.
Link both texts to the clipboard as alternative formats for a dynamic item
Perform an automatic Paste into the Word-Document which will grab the Word-Format text from the clipboard by default
If it's not Word it'll grab the generic text 'cause it can't handle the Word-Format text but only if you supply it in a generic format, otherwise it will see no content, paste will be disabled.
That way you don't have to identify the target app at all which is a kind of iffy thing to do.
It does sound quite ambitious for an MFC beginner. It freaked me out the first time I debugged some Clipboard code and of course with the Clipboard locked Cut/Copy and Paste stops working in the Debugger Made me realize how much I use it.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Perform an automatic Paste into the Word-Document
That way you don't have to identify the target app at all
How can i perform the automatic paste into word from out my own application without knowing where the paste should be performed?
|
|
|
|
|
Because it's automatic. Word is already a drop target. Microsoft implemented it for you but what they do when you drop something on Word is going to depend on what type of data it's linked to, file, Word format text, plain text, image etc.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Oha! Nice
OK, i'll try it in some weeks.
Big thanks for your explains
|
|
|
|
|
I have an data-acquisition application in which data-logging is
performed constantly and data is stored in a CF Card, which acts as the primary data-storage device for the system.
The Windows CE image that i have loaded has support for automatic
detection of USB mass storage devices.
The User can retrive the data from the system (CF Card) thru USB Drive.
There is no screen or console , it is an industrial Controller.
The data acquistion goes on constantly , and the applicaiton
periodically polls the USB slot to see if the user has inserted any
USB Drive in it.
For this, i use the standard CreateFile() function in order to detect
if the user has inserted USB Pen Drive into USB slot or not. I get the
handle to the device using CreateFile(), is user has inserted it.
If he has, then all reqd. data from the CF Card is copied to the USB drive.
if ((hFile=CreateFile(_TEXT"DSK2:",GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE, NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL))!=INVALID_HANDLE_VALUE)
{Do further processing}
NOTE: Here DSK2: is the disk number of the Pen Drive
Whenever the user insertes the USB Drive, the OS detects this, and
CreateFile function therefore returns successfully with the USB dive
handle. Thus, USB Drive is detected.
Now, the problem is that sometimes, although the Pen Drive is
inserted, it is not detected by the OS, whearas at other times it is.
That is, in the Windows Explorer, where I can see the CF Card mounted
as "Hard Disk" and USB Pen Drive as "Hard Disk2", sometimes, this
"Hard Disk2" is not seen. It leads me to the conclusion that the USB
Dive is not mounted by the Windows Device Manager. Even if i remove the Pen Drive and re-insert it, it will not be detected hence-forth , once it is not detected. I don't know how to make the OS detect it then , the only way i know is rebooting the system. (Which is definetely not the solution!!)
What can possibly be causing this irregular behavior?
At such times, I cannot obtain a handle to the device using
CreateFile. Is there any alternate way to obtain access to the USB
device, rather than relying on Windows OS, and the Device Manager??
I have also completely checked the hardware, to verify that there is
no problem on hardware side, no loose connections etc. Another
important point is that the LED on the USB Pen Drive always glows when
I insert the Pen Drive, even when it is not detected by Windows CE.
Regrds,
CR
|
|
|
|
|
|
Hey Mathew
Thanks for ur inputs.
Can u give me further details about what WiCE OS version yours was. I m using Win CE 5.0, and hv just downloaded the patches yesterday.
Meanwhile, I tried to get the low level descriptor on CF and USB,but without any luck. I tried using FindFirstStore , FindNextStore functions but they give me the device name nicely, but not the device type...I am getting some garbage value in StoreInfo.dwDeviceType.
this is my source code:
STOREINFO SI;<br />
HANDLE hStore;<br />
int err=0;<br />
<br />
SI.cbSize=sizeof(STOREINFO);<br />
hStore=FindFirstStore(&SI);<br />
if (hStore!=INVALID_HANDLE_VALUE)<br />
{<br />
<br />
while(1)<br />
{ <br />
printf("Device type :\n");<br />
switch (SI.dwDeviceType)<br />
{<br />
case STORAGE_DEVICE_TYPE_PCIIDE :<br />
printf("1\n");<br />
case STORAGE_DEVICE_TYPE_FLASH :<br />
printf("2\n");<br />
case STORAGE_DEVICE_TYPE_ATA :<br />
printf("3\n");<br />
case STORAGE_DEVICE_TYPE_ATAPI :<br />
printf("4\n");<br />
case STORAGE_DEVICE_TYPE_PCCARD :<br />
printf("5\n");<br />
case STORAGE_DEVICE_TYPE_CFCARD :<br />
printf("6\n");<br />
case STORAGE_DEVICE_TYPE_SRAM :<br />
printf("7\n");<br />
case STORAGE_DEVICE_TYPE_DVD :<br />
printf("8\n");<br />
case STORAGE_DEVICE_TYPE_CDROM :<br />
printf("9\n");<br />
case STORAGE_DEVICE_TYPE_USB :<br />
printf("10\n");<br />
case STORAGE_DEVICE_TYPE_1394 :<br />
printf("11\n");<br />
case STORAGE_DEVICE_TYPE_DOC :<br />
printf("12\n");<br />
case STORAGE_DEVICE_TYPE_UNKNOWN :<br />
printf("13\n");<br />
case STORAGE_DEVICE_TYPE_REMOVABLE_DRIVE :<br />
printf("14\n");<br />
case STORAGE_DEVICE_TYPE_REMOVABLE_MEDIA :<br />
printf("15\n");<br />
default:<br />
printf("Not identified - %lu\n",SI.dwDeviceType);<br />
}<br />
<br />
printf("Device Name : %S\n",SI.szDeviceName);<br />
printf("Store Name : %S\n",SI.szStoreName);<br />
<br />
if (FindNextStore(hStore,&SI)==FALSE)<br />
{<br />
err=GetLastError();<br />
printf("No more devices - %d\n",err);<br />
FindCloseStore(hStore);<br />
break;<br />
}<br />
}<br />
}<br />
else<br />
{<br />
int err=GetLastError ();<br />
printf("Could not get the handle! - error %d\n",err);<br />
<br />
}
And these are the results:
<br />
Device Name : DSK1:<br />
Store Name : IDE Hard Disk Drive<br />
Device Type : <br />
Not identified - 215290179 <br />
<br />
Device Name : DSK2:<br />
Store Name : USB Hard disk Drive<br />
Device Type : <br />
Not identified - 215290179
|
|
|
|
|
Sorry to take so long to reply, have been away for nearly a week until yesterday.
Yes we use CE 5 but as you know everyone builds their own with CE so it may or may not be much similar to yours. The device names you're seeing are coming from the driver layer. If you've not written the driver yourself then these are probably ones that came with your Board Support Package. I don't deal with anything below the level of Platform Builder options for our products I'm afraid so I can't tell you much about how the drivers work. Ours are at least somewhat customised. I used various 3rd party Disk analysis tools on an ordinary Win XP PC to examine the CF card low level descriptors and discovered the unreported manufacturing change from Removable to Fixed. Our CE drivers had started reporting CF cards as 'IDE Hard Disk' which caused all sorts of havok. Our supplier at the time Pretec were very reluctant to admit to it and eventually claimed it is something going on throughout the industry.
At least you've been able to get the name for DSK2 and it is recognizably a USB disk. If you take USB to equate to removable, which I suppose depends on your hardware, then you've found it. To get any more and better particulars I guess you'll probably have to dive into the driver layer. Good luck
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Hi guys,
I have a problem that I need to call a 32-bit DLL from 16-bit Windows program. Is there is way to do this then kindly suggest and help me.
Thanking You !
Amitabh Mishra
|
|
|
|
|
I played around with "thunking" about 15 years ago. It hasn't crossed my mind since. What exactly are you looking for?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: "thunking"
Whoa - there's a word I haven't heard or used in a long long time
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
|
Hi
<br />
CList<class Customer> ListCustomers;<br />
<br />
Customer * pJohn = new Customer("John");<br />
Customer * pMary = new Customer("Mary");<br />
ListCustomers.AddTail(pJohn);<br />
ListCustomers.AddTail(pMary);<br />
Question is, should I manually delete allocated memory?
Thanks
devy
|
|
|
|
|
Yes, when you remove the element for the list, you should delete the memory. But you should do that only when the element is removed from the list.
|
|
|
|
|
Thanks... so I should do this?
<br />
CList ListCustomers;<br />
<br />
Customer * pJohn = new Customer("John");<br />
Customer * pMary = new Customer("Mary");<br />
ListCustomers.AddTail(pJohn);<br />
ListCustomers.AddTail(pMary);<br />
<br />
delete pJohn;<br />
pJohn = NULL;<br />
delete pMary;<br />
pMary = NULL;<br />
ListCustomers.RemoveAll();<br />
devy
|
|
|
|
|
In general, you add elements to the list and you don't keep the pointers to each individual elements (otherwise, why would you use a list ??). So, when you want to empty the list, you don't have those pointers directly but they are stored in the map. What you have to do is just iterate through your list and delete each item in the list and then call RemoveAll.
In other situations, it can also happen that you want to remove only one element from your list. Then, you simply delete this element and remove it from the list.
Hope that helps
|
|
|
|
|
I have a Resource file from where Dialog takes the static content that i want to display.
say LTEXT "Select",IDC_STATIC,....
where "Select" would gets displayed on to the dialog box on pop up
But I don't wanna do this way ...
Wat i want is smthng like
LTEXT str_Data,IDC_STATIC,...
where
str_Data is of type CString and gets its value from a function
say...
str_Data = getData("Select");
and Function is CString getData(LPCTSTR);
or sumthng like #define str_Data
and LTEXT str_Data,IDC_STATIC,...
and the rest remains same as above
Do , anyone has any idea...
|
|
|
|
|
I dont understand what do you need?you have a file and you want to display content of this file with a static control,right?
|
|
|
|