|
Have a look at WM_DROPFILES. I haven't done much with console apps, but this is what you use in a Windows app. Also CWnd::OnDropFiles(). This is what I use in ED (see sig) if the user drops a file on it, whether it is running or not. Hope that helps.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
IMO you will need a winapp to do this.
A very easy way to do this is :
Make a batch file (like the following, just replace [destination path] with your path.)
@echo off
if "%1" == "" goto end
if not exist %1 goto end
copy %1 [destination path]
:end
Put the batch file (name it mycopy.bat) iy your windows SendTo directory.
Now every time you want to copy a file, right-click on it, go in the SendTo submenu and click on mycopy.bat. Your file will be copied.
~RaGE();
|
|
|
|
|
Hi
Need to convert a DWORD to a CString
and a CString to a DWORD type.
Hope someone knows
Greetings
Jens
|
|
|
|
|
Hi,
converting a CString into DWORD means, u are going to covert integer to char
here is example.
#define HELLO 100
DWORD dwrd=HELLO;
CString str1;
char str[10];
str1=itoa(HELLO,str,10);
//CString str1=str;
AfxMessageBox(str1);
this will convert the DWORD into CString,but it is not wise.You can't get CString value like "HELLO". it is not possible i think.you can get 100 as a CString value.
yakkalas
|
|
|
|
|
DWORD is also an unsigned integer,trying to convert it into CString means converting integer to char.
Here I am sending simple Ex.
DWORD dwrd=HELLO;
CString str1;
char str[10];
str1=::itoa(HELLO,str,10);
//CString str1=str;
AfxMessageBox(str1);
This simple code will show u 100 not HELLO.So as I am thinking,it is not possible.
You mean to try to get CString value as HELLO?
if so it is not possible as per my knowledge.
yakkalas.
|
|
|
|
|
DWORD is also an unsigned integer,trying to convert it into CString means converting integer to char.
Here I am sending simple Ex.
#define HELLO 100
DWORD dwrd=HELLO;
CString str1;
char str[10];
str1=::itoa(HELLO,str,10);
//CString str1=str;
AfxMessageBox(str1);
This simple code will show u 100 not HELLO.So as I am thinking,it is not possible.
You mean to try to get CString value as HELLO?
if so it is not possible as per my knowledge.
yakkalas.
|
|
|
|
|
Well, it's like this i wanted:
I got a CString strValue = "5";
But i got a function which only accepts DWORD values;
so instead of CString strValue = "5";
It need to be converted to:
DWORD dvalue = 5;
that's all to it actually.
|
|
|
|
|
CString strValue="5";
DWORD dValue=atoi(strValue);
then dValue contains what is the value in strValue.
dValue=5;
yakkalas
|
|
|
|
|
|
ok thanks for your help all.
I fixed the problem like this:
//CString -> long integer
CString strBurnr = m_listbur.GetItemText(1,2);
DWORD burnr = atol(strBurnr);
//Long Integer -> CString
char* szTemp;
ltoa(burnr, szTemp,10);
CString strTemp;
strTemp = (CString) szTemp;
Thanks, all works fine.
and btw (this isn't about conversions: does anyone of you guys know how to put a button in a field (in CListView) at every row?)
Greetings
Jens
|
|
|
|
|
JensB wrote:
char* szTemp;
ltoa(burnr, szTemp,10);
This can't work. You've allocated no memory for szTemp. It's just a pointer pointing to who knows where!
To get a number, whether its an int, long, etc, into a CString object, just use CString::Format() as in:
DWORD dwNumber = 123;
CString strTemp;
strTemp.Format("%lu", dwNumber);
|
|
|
|
|
yeah i'm sorry
I made a typo there
i had 'char szTemp[10];' here
Anyway, thanks
|
|
|
|
|
DWORD-STRING itoa()
STRING-DWORD atoi()
[ It is possible to represent everything in this universe by using 0 and 1 ]
|
|
|
|
|
Hi, I am currently writing a program in VC++ trying to find a particular word from a MS word document without opening MS word. I have imported the Type Library of MS Word and I have figured out how to Open, Close and Print documents but i have no idea on how to do a search to find a particular word.
Does anyone know how to do this or does anyone know where I can find more information on this ?
Thank you!
|
|
|
|
|
Have you looked into the Words and/or Find classes?
|
|
|
|
|
COleVariant covTrue((short)TRUE);
COleVariant covFalse((short)FALSE);
COleVariant covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
BOOL bWildCard = vtWildCard.boolVal;
CString csFind = vtFind.bstrVal;
CString csValue;
VARIANT vtWholeWord;
vtWholeWord.vt = VT_BOOL;
if ( bWildCard )
vtWholeWord.boolVal = FALSE;
else
vtWholeWord.boolVal = TRUE;
Selection m_oSel;//selection class
m_oSel = m_oApp.GetSelection();
m_oSel.SetStart(0);
//Finf m_oFind
m_oFind = m_oSel.GetFind();
//here s the FIND method - one you want...
if(m_oFind.Execute( &vtFind, covFalse, &vtWholeWord, &vtWildCard, covOptional, covOptional,
covTrue, COleVariant( (short) 1 ), covOptional, &vtReplaceWith, &vtReplace, covOptional,
covOptional, covOptional, covOptional ) )
{
_variant_t vtUnit((long) 4);
m_oSel = m_oApp.GetSelection();
//Range m_oRange - Range Class
m_oRange = m_oSel.GetRange();
m_oRange.Expand(&vtUnit);
m_oRange.Select();
csValue = m_oRange.GetText();
hope that now you got the idea..
[ It is possible to represent everything in this universe by using 0 and 1 ]
|
|
|
|
|
Hi,
I have a Win32 Application with me. The application runs with suppporting dll files.I want to call the application(.exe) from FLASH program . I have put all the files in one directory. But I am unable to call the application. Do I need to add something else also. Please guide me.
Regards,
Abhijit
|
|
|
|
|
You can use the flexbrige library!
It's open source!
http://blog.csdn.net/laiboy
|
|
|
|
|
Hi,
I have a Win32 Application with me. The application runs with suppporting dll files.I want to call the application(.exe) from FLASH. I put all the files in one directory. But I am unable to call the application. Do I need to add something else also. Please guide me.
Regards,
Abhijit
|
|
|
|
|
Hello~
I make a program about tree control. I want to muli-select of my tree control items. When I get an item name, how could I highlight the item on tree control. I have no ideal about these two problems. Can anyone give me a hand please?
Thanks a lot.
|
|
|
|
|
CTreeCtrl doesn't handle multiple selections. Have a look at CTreeCtrlEx at http://www.techsoft.no/bendik/[^] I use this in some parts of ED (see sig) as well as my own custom tree control (see the ED ClassView).
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Thanks for your help.
Does anyone do me a favor for my question2:
When I get an item name, how could I highlight the item on tree control.
I had tried SetCheck function. But it could not hightlight the item what I give.
|
|
|
|
|
qweas wrote:
I had tried SetCheck function. But it could not hightlight the item what I give.
You need to "select" the item:
CTreeCtrl::Select(HTREEITEM hItem, UINT nCode)
eg.
Select( hItem, TVGN_CARET );
See the CTreeCtrl documentation.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
I have a dialog based applicattion, which uses hotkey accelerators. I used Nish's article concerning hotkeys with dialog based apps. It works fine, but I want to display the hotkey in the menu item that corresponds to the hotkey, as is standard in windows apps. Problem is, I can't get the text to line up on the right hand side, so all of the hotkeys are lined up on the right, like in most windows apps, like IE. Is there a way to set the menu item text so part of a second part of the text is lined up, so I can enter the hotkeys manually? Thanks!
|
|
|
|
|
Try separating the text from the accelerator by using a tab. Ex: &My Menu Item\tCtrl+M
|
|
|
|