|
You could always wrap "net send" in your own application by using ShellExecute().
Cheers,
Fredrik
"Felix qui potuit rerum cognoscere causas."
|
|
|
|
|
Whats shellexecute() iv'e only been programing 2 weeks?
|
|
|
|
|
Check it out in MSDN. If you don't have it installed, check this[^] out.
Cheers,
Fredrik
"Felix qui potuit rerum cognoscere causas."
|
|
|
|
|
I want get a associated icon from a file system (for example c:\test.doc") using SHGetFileInfo function and save it in a file (for ex "C:\myicon.ico").
But GlobalSize and GlobalLock returns 0 (invalid value!!!).
Please give me a good idea!
Tnk you
/******MY CODE*****/
CString nomefile = "c:\\test.doc";
HICON hGen32Icon;
HIMAGELIST hSysImageList;
SHFILEINFO shfi;
int fh;
UINT uiSize;
DWORD dwSize;
LPVOID lpGMem;
OFSTRUCT of;
hSysImageList = (HIMAGELIST)SHGetFileInfo
(nomefile,
0,
&shfi,
sizeof (SHFILEINFO),
SHGFI_SYSICONINDEX | SHGFI_SMALLICON);
hGen32Icon = ImageList_GetIcon (hSysImageList,
shfi.iIcon,
ILD_NORMAL);
dwSize = GlobalSize(hIcon); /*Don't work*/
lpGMem = GlobalLock(hIcon); /*Don't work*/
fh = OpenFile ("c:\\myicon.ico", &of, OF_WRITE | OF_CREATE);
if (fh == -1) // If NOT opened successfully.
{
MessageBox("Unable to create file", NULL, MB_OK );
}
uiSize = _lwrite(fh, (LPSTR)lpGMem, (UINT)dwSize);
_lclose(fh);
|
|
|
|
|
|
Hi,
Currently, I need to do read/write on disk sector under Win2000/XP. I found out that the statement below is only valid for administrator.
hDisk=CreateFile("\\\\.\\C:", GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, NULL, NULL);
...
For non-admin user, the above statement will always return hDisk=INVALID_HANDLE_VALUE. My question is how can we solve this problem? Can we assign access right or privilege in our program in order to access disk sector? or do we need to develop VXD to solve this problem?
Hope that some of you can give me some hints. Thanks in advance!
Best Regards,
K Wan
|
|
|
|
|
Yes my friend
As far as my Knowledge
u will neet a service to do the above work
and not a VXD cause VXD is required on 9X M/C
and No such funda like aadministrator in 9X M/C
ok i hope this solev ur prob..
Thanx
TAKE CARE
|
|
|
|
|
Thanks for pointed out my mistake and confusion.
Basically, what does the service do in this problem? Can the service use 'CreateFile' to access the disk sector for non-admin user?
Since the security context for file system root (eg: 'c:','d:') will be lost every time we restart the computer, how do we solve this problem?
More hints and guides for me?
Thanks!
|
|
|
|
|
whenever i add items from a treelist to a list box, the items are jumbled up and not in the order in which i was adding one by one. i use the following code :
HTREEITEM hTreeItem1;
HTREEITEM hTreeItem2;
HTREEITEM hTreeItem3;
hTreeItem1 = m_tree.GetSelectedItem ();
hTreeItem2 = m_tree.GetParentItem(hTreeItem1);
hTreeItem3 = m_tree.GetParentItem (hTreeItem2);
if(hTreeItem3 != NULL){
m_strlist_process = m_tree.GetItemText(hTreeItem3)+m_tree.GetItemText(hTreeItem2)+m_tree.GetItemText(hTreeItem1);
}
else
m_strlist_process = m_tree.GetItemText(hTreeItem2)+m_tree.GetItemText(hTreeItem1);
m_list.AddString(m_strlist_process);
UpdateData(FALSE);
btw, as i wan to display the 3 items, how to have spcaing between them so that they wun appear all join together in a line? thanx
|
|
|
|
|
Your list box probably has the sort property set by default. Turn it off et voilá (I hope ).
Cheers,
Fredrik
"Felix qui potuit rerum cognoscere causas."
|
|
|
|
|
thanx! i disabled it and it works now, but the prob left is the items are displayed together in a line without spacing. i type
m_strlist_process = m_tree.GetItemText(hTreeItem2)+" "+m_tree.GetItemText(hTreeItem1);
it din work, any solution?
|
|
|
|
|
If m_strlist_process is a CString, it should work the way you wrote it with " ". Otherwise I think you should get compilation errors.
Cheers,
Fredrik
"Felix qui potuit rerum cognoscere causas."
|
|
|
|
|
Hi all,
I am using WTL, I have my own class called CMyHeaderCtrl which inherites from CHeaderCtrl (this is not MFC, but WTL)....
in my List Control i am usnig the following code:
void CMyListCtrl::InitListCtrl()
{
CHeaderCtrl header = GetHeader();
m_HeaderCtrl.SubclassWindow(header.m_hWnd);
}
where m_HeaderCtrl is from the type CMyHeaderCtrl...
the implementation of SubclassWindow in CMyHeaderCtrl is as follows:
void CMyHeaderCtrl::SubclassWindow(HWND hWnd)
{
CWindowImpl<cmyheaderctrl, cheaderctrl="">::SubclassWindow(hWnd);
}
touble is that for this line i get an error :
"
error C2352: 'ATL::CWindowImplBaseT<class WTL::CHeaderCtrlT<class ATL::CWindow>,class ATL::CWinTraits<1442840576,0> >::SubclassWindow' : illegal call of non-static member function<br />
c:\program files\microsoft visual studio\vc98\atl\include\atlwin.h(2052) : see declaration of 'SubclassWindow'<br />
Error executing cl.exe.
I tried the following code with my own CStatic class, and it worked, why doesn't it work with CHeaderCtrl????
can any1 help here?
thanks in advanced
Yaron
|
|
|
|
|
I have some Dll's, created with Delphi, that using BDE.
And i have programm created with VC that using this Dll's
The problem is: if i have launched some programm "x", that using BDE, then after creation CWinApp object, error appears "BDE is not initialized". And if there is no launched "x" everything works fine.
|
|
|
|
|
hello, i didn't know that there is a func of ExistFile ,and how to use .
thank you
|
|
|
|
|
You can simply use fopen and check the return type:
BOOL ExistFile(char* FileName)
{
FILE* hFile;
hFile = fopen(FileName,"r");
if (hFile)
{
fclose(hFile);
return TRUE;
}
return FALSE;
}
|
|
|
|
|
thank you very much ,I am Chinese boy .
|
|
|
|
|
int _access( const char *path, int mode );
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
Thank you very much ,I am chinese boy .
|
|
|
|
|
HI,
I have realy hard task. I need create program`s shortcut and I found on the Internet, that I must use IShellLink interface. But on Microsoft site (MSDN) I found the code - http://msdn.microsoft.com/library/...[^] - and this code doesn`t work ... function CoCreateInstance failure (I think)...
piece of code:
HRESULT hres;
IShellLink* psl;
hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID*)&psl);
Tomas
|
|
|
|
|
Take a look at CShellLink.
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
:-DHello..
I'd loaded two 24-BIT BITMAPS into the memory..
the 1st one into CDC m_dcMem1, and the second bitmap into CDC m_dcMem2.
Ok.. both of the images are the same..just the 1st Bitmap image, i'd done a little bit of editing of some of its LSB (i'm doing digital watermarking)..
so now..i loaded the watermarked image..and the original image..
what function should i use to check either both of the images is same or not?
What i mean..is..if i loaded two same original BITMAP.. after i perform the function.. it should come out with the result that both of the images is the same..
so..i hope you guys can help me..what function should i use? GET PIXEL?? then compare it??
really urgent..
thanks in advance..
have a nice day!
Thong
twh81@tm.net.my
...
|
|
|
|
|
hmmmmm
getpixel() on all the pixels in a bitmap could get incredibly slowwwwwww on big images ... maybe generate a checksum for each image and compare those?
"there is no spoon" biz stuff about me
|
|
|
|
|
Hello lauren..
thanks for the reply and ideas..
I think i need more explanation and details about the GETPIXEL method... i think i will not care if it is a very slow way.
as long as i can execute and it WORKS!!..
i really need help in doing this...i need details and infos how should i carry on..
also..by the way..do you mind to explain how the CHECKSUM works?
thanks.
nice day!
Thong
...
|
|
|
|
|
Hi, I am developing an MDI application to load .bmp,.tiff and DIB files. For bmp the program works fine but for tiff it displays "error in opening DIB file". What I've found so far in the web is a program which display only tiff file. Anyone can help me? Quite urgent... deadline approaching and I am real beginner in MFC... thx in advance
crinoidea
|
|
|
|