|
I forgot to include one of the functions that I call in the code sample above and I am including it below.
bool CInstall::GetShellFolderPath(LPCSTR lpShellFolder, LPSTR lpShellPath)
{
//lpShellFolder can be one of the following
//AppData, Cache, Cookies, Desktop, Favorites, Fonts, History, NetHood,
//Personal, Printhood, Programs, Recent, SendTo, Start Menu, Startup,
//Templates, ShellNew
DWORD rc;
DWORD length = MAX_PATH;
DWORD type = REG_SZ;
HKEY hkey;
rc = RegOpenKeyEx(HKEY_CURRENT_USER,
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",
0,
KEY_READ,
&hkey);
if (rc == ERROR_SUCCESS)
{
rc = RegQueryValueEx(hkey,
lpShellFolder,
NULL,
&type,
(BYTE *) lpShellPath,
&length);
RegCloseKey(hkey);
}
if (rc == ERROR_SUCCESS)
return true;
else
return false;
}
Bill SerGio, The Infomercial King
|
|
|
|
|
Have not tested, but if you say a UNICODE build will work
it is maybe because there are 2 IShellLink interfaces, one
IShellLinkA and one IShellLinkW, and if that happens to be
the case you could build an ANSI app and use IShellLinkW and get
it to work
|
|
|
|
|
So if this is the case, then:
if (b2000 || bNT) {
// Call "IShellLinkW"
}
else {
// Call "IShellLinkA"
}
Is this what you had in mind to build 2 versions in one class?
What I don't understand is why hasn't anyone posted a sample of this code before?
Bill SerGio, The Infomercial King
|
|
|
|
|
I was thinking, just query for IShellLinkW, if you get it, use it.
Otherwise use IShellLinkA.
|
|
|
|
|
Anyone know ehre to get some ASPI documentation?
Thanks in advance.
|
|
|
|
|
|
I was just wondering if there was a way to turn on and off the keyboard lights for CapsLock, NumLock and ScrollLock programmatically.
any help appreciated
"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it" Nish on life [methinks]
"It's The Soapbox; topics are optional" Shog 9
|
|
|
|
|
What! Brian Delahunty is asking a programming question
Look here. Clickety
I have never wasted time worrying about such insignificant things. Keep your eye upon the donut and NOT upon the hole. - Bill Sergio in The Lounge - June 23, 2002
|
|
|
|
|
Thanks I should have known that!!!!!!!!!
"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it" Nish on life [methinks]
"It's The Soapbox; topics are optional" Shog 9
|
|
|
|
|
How can I get the style of a window class.
Ex: I have a window (handle=0x00000b94, class name=#32770(dialog) )
I want to get the styles and extended styles of it as CS_DBLCLKS, WS_EX_CLIENTEDGE....
How can I do that ?
I try this way:
LONG lStyles=::GetWindowLong(hwnd,GWL_STYLE);
LONG lExStyles=::GetWindowLong(hwnd,GWL_EXSTYLE);
CString strStyles;
if ((lStyles&BS_OWNERDRAW)==BS_OWNERDRAW)
strStyles+="BS_OWNERDRAW";
if ((lStyles&CS_VREDDRAW)==CS_VREDDRAW)
strStyles+="CS_VREDDRAW";
...
...
(hundreds of "if" !!!!!!!!!!!!!!!)
Help me !
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
dlhson wrote:
extended styles of it as CS_DBLCLKS, WS_EX_CLIENTEDGE
First off the CS_DBLCLKS is a CLASS style, not a window style
the GetWindowLong, using the GWL_STYLE or GWL_EXSTYLE will only return you the window styles (i.e. WS_XXX ,or WS_EX_XXX)
for CS_XXX you need to call GetClassLong( hwnd, GCL_STYLE )
As far as conmverting them to a string, I think you are stuck with a big if/else statement, sorry !
|
|
|
|
|
Dear All,
how can i solve the problem of including the View class header file in the MainFrame.cpp file. when do so an error occure about the GetDocument(); declaration in the view header file.the error says "error C2143: syntax error : missing ';' before '*'"
thanks,
Mohammad Zakarni
|
|
|
|
|
You need to include the document class as well. The error is because GetDocument returns a pointer to a document object, so you need to include it first, so it knows what that is.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
Cool thank you it worked...
Thanx;)
|
|
|
|
|
I got the same error C2143 when I moved a snippet of working code to open a file and load a list box. I put the code in a new file as a good programming practice and I think the error was related to the include header:
#include <fstream>
using namespace std;
Any suggestions?
When you come to a fork in the road, take it! Y. Berra
|
|
|
|
|
doubl00 wrote:
#include
using namespace std;
Any suggestions?
1. Check 'display this message as is' or use < and > to do < >
2. NEVER use all of namespace std.
3. I really don't know, because I don't know what you included. The problem will be different now, because it's obviously std library stuff you're using. Could you post the offending code and the name of the header ?
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
When i edit my menu in the resource editor it is OK, but when i start the app, it is
disabled, and i cannot enable it, i tried with handling WM_INITMENU, and enabling the
items there but no success. Only E&xit it OK, it is the only menu item that works,
why is that ?
And another question... Is there any significance which class will contain the menu's
ON_COMMAND handlers ?
|
|
|
|
|
if you are using MFC the menu handler will need to be in a class that has an instance available ..... if you have the menu handler in a doc class that has no open document...then MFC will disable the menu item for you...since there is no handler available to service the request.....if that is not the case, give a little more detailed info.....about the problem
1. The Lord loves a workin' man.
2. See a doctor and get rid of it.
3. Don't trust whitey.
|
|
|
|
|
I am Korean and weak English.
I want fax brodcasting service. But I don't know how to use below three API.
I want to know how to working together three below API.
FaxSendDocumentForBroadcast()
FaxCompleteJobParams()
FAX_RECIPIENT_CALLBACK()
Please help me. I searched MSDN and web site.
But there no detail data about FaxSendDocumentForBroadcast().
I attach my fax broadcast project source code.
Thank you very much.
BOOL CALLBACK CALLBACK FAX_RECIPIENT_CALLBACK(
HANDLE FaxHandle, //handle to the fax server
DWORD RecipientNumber, //index indicating current fax recipient
LPVOID Context, //pointer to context information
PFAX_JOB_PARAM pfxParam, // [in,out] pointer to job information structure
PFAX_COVERPAGE_INFO pcpInfo ) // [in,out] pointer to local cover page structure
{
pfxParam->SizeOfStruct = sizeof(FAX_JOB_PARAM);
pfxParam->RecipientNumber = pszFaxNumber; // recipient's fax numbe
pfxParam->ScheduleAction = JSA_NOW; //schedule the transmission at any time in the next 24 hours
if(RecipientNumber > 10) return FALSE;
else return TRUE;
}
void CFaxClientDlg::SendFax()
{
if(!FaxConnectFaxServer(NULL, &fxHandle))
{
DWORD dwError = ::GetLastError();
switch(dwError){
case ERROR_INVALID_PARAMETER:
break;
case ERROR_NOT_ENOUGH_MEMORY:
break;
}
ReportOSError();
FaxClose(fxHandle);
return;
}
/*
if(!FaxCompleteJobParams( &pfxParam, &pcpInfo ) )
{
ReportOSError();
FaxClose(fxHandle);
return;
}
*/
if( FaxSendDocumentForBroadcast(fxHandle, pszFileName, &dwJobId, FAX_RECIPIENT_CALLBACK, NULL) ) /* [out] dwJobId */
AfxMessageBox("SendDoc Succeeded");
else ReportOSError();
// Cleanup here
FaxFreeBuffer(pfxParam);
if ( pcpInfo )
FaxFreeBuffer(pcpInfo);
FaxClose(fxHandle);
}
|
|
|
|
|
you didn't find indo on MSDN on this because, (I believe), this is not part of the OS API, Windows has traditionally never provided fax support....this is probably a 3rd party lib, you need to consult the vendor documentation....if Windows is now supporting Fax thru API then it is a new one on me, wouldn't be the first time though!!!!
1. The Lord loves a workin' man.
2. See a doctor and get rid of it.
3. Don't trust whitey.
|
|
|
|
|
Thank you very much.
Windows is now supporting Fax Service and Fax Client API.
From Windows 2000, Windows support FAX SERVICE and I just want to program
fax client.
Below three API is FAX CLIENT API. But I nerver know how working together three API.
FaxSendDocumentForBroadcast()
FaxCompleteJobParams()
FAX_RECIPIENT_CALLBACK()
|
|
|
|
|
hi,
why does using const referance slow down the program and increase the program size,its referance any way,no need to copy anything?I read this in oneof the articles here.
julie
|
|
|
|
|
Have you verified this ? It sounds strange to me.... Slow down I would investigate to see if it was true, although I can't see why ( surely making a copy would slow things down ? ), but there is no reason I can see why it could make a program bigger.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
annie julie wrote:
why does using const referance slow down the program and increase the program size
Are you sure this is the case???? Maybe it does make the program bigger but I'd guess only marginally, but I can't see how it would slow down a program... weird
"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it" Nish on life [methinks]
"It's The Soapbox; topics are optional" Shog 9
|
|
|
|
|
It doesn't. A reference is just a pointer internally.
Shockingly, not everything you read on the internet is automatically true.
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|