|
That checkbox never worked for me....
I would modify .dsp to:
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
TargetPath=.\Release\My.lib
from
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /dll /machine:I386
# ADD LINK32 /nologo /subsystem:windows /dll /machine:I386
|
|
|
|
|
When I use the MAPISendMail command with the MAPI_DIALOG flag it brings up the dialog in Outlook (loading mapi32.dll library) and Outlook Express (loading msoe.dll library). If the mail client is closed, the message will send in Outlook Express, but will sit in the outbox of Outlook until the program is opened and the send/receive button is pressed.
How can I change this behavior?
I can't create a new process of outlook.exe because I do not know if the mail has been sent before killing the process...
Help please, last time I submitted this question I only got one response (which unfortunately did not work out). Thank you in advance...
~LizardWiz()
|
|
|
|
|
Can you provide a code snippet of how you are using the mail API?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
This is sort of it, except that I am also attaching a file with a MapiFileDesc structure...
LPMAPILOGON lpfnMAPILogon;
LPMAPISENDMAIL lpfnMAPISendMail;
LPMAPILOGOFF lpfnMAPILogoff;
LHANDLE lhSession;
HMODULE hMAPILib;
MapiRecipDesc sender =
{
0,
MAPI_ORIG,
"anyone",
"anyone@anywhere.com",
0,
NULL
};
MapiRecipDesc recipient =
{
0,
MAPI_TO,
"someone@anywhere.com",
NULL,
0,
NULL
};
MapiMessage message =
{
0,
"Some subject",
"Some message text",
NULL,
NULL,
NULL,
0,
NULL,
1,
&recipient,
0,
NULL
};
hMAPILib = LoadLibrary("either MAPI32.DLL or MSOE.DLL depending on MSO or MSOE");
lpfnMAPILogon = (LPMAPILOGON)GetProcAddress(hMAPILib, "MAPILogon");
lpfnMAPISendMail = (LPMAPISENDMAIL)GetProcAddress(hMAPILib, "MAPISendMail");
lpfnMAPILogoff = (LPMAPILOGOFF)GetProcAddress(hMAPILib, "MAPILogoff");
(*lpfnMAPILogon)(0, NULL, NULL, 0, 0, &lhSession);
(*lpfnMAPISendMail)(lhSession, 0, &message, MAPI_DIALOG, 0);
(*lpfnMAPILogoff)(lhSession, 0, 0, 0);
FreeLibrary(hMAPILib);
~LizardWiz()
|
|
|
|
|
Essentially, later versions of Outlook are configured to do this, so as to slow the spread of email worms. See:
http://support.microsoft.com/?kbid=290499[^]
for information on how to alter this (and other security-related) behavior.
Note: as far as i'm aware, this does not apply to Extended MAPI, so you may wish to give that a look. Or just tell your users it's for their own good.
Zno one puts flowers on a flower's grave
|
|
|
|
|
Hi you out there,
I'm a C++ beginner trying to pass one (two) array(s) to a function but
the problem now is that I got different versions of passing such an array
to a function...
Please consider the following example:
I've got a two pre-defined array of let's say six elements:
int MyArray[6];<br />
int MySecondArray[6];
Now I wrote a functions - it even works - that uses the first array to change the second.
It is declared as follows:
void ChangeSecondArray(const int pFirst[], int pSecond[])
{<br />
if(pFirst[0] == 7)<br />
pSecond[2] = 5;<br />
}
The only thing I want to know is: Does this code only work because I use VC++ 6.0 or is it actually correct the way I've coded it? If not, would one of you please be so kind and tell me how to do it correctly (please remember: I know the size of the array prior to using it within the function, it never changes).
Thanks in advance,
pf7
|
|
|
|
|
You have coded it correctly. Were you to change the statement to if (pFirst[0] = 7) instead, you would receive the expected error message.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Sorry, I haven't been at home for a while, so I wasn't able to reply to your answer
Thank you for the quick 'n easy answer
pf7
|
|
|
|
|
pf7 wrote:
I'm a C++ beginner trying to pass one (two) array(s) to a function
If you're coding in full C++ without support for legacy C code, I would suggest that you pass vectors[^] instead of arrays. It may seem intimidating at first, but I feel it would be worth learning.
~Nitron.
ññòòïðïðB A start
|
|
|
|
|
Hello,
I'm using Visual C++ 6, and I'm trying to duplicate my work from the Borland complier. I want to hook interrupt functions via the 'interrupt' keyword but it seems the Visual complier does not support this keyword. Also I've tried using _dos_getvect() and _dos_setvect() but again the complier won't have it.
Is it possible to do what I'm trying to do under Visual C++ 6?
The project I built is Win32 console application.
Many thanks for any help.
|
|
|
|
|
Joe_G wrote:
Also I've tried using _dos_getvect() and _dos_setvect() but again the complier won't have it.
That's because those are old 16-bit conventions. You can do inline assembler using the _asm keyword.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I hope you know that interrupt handling and hardware access are very different in the Win32 environment than your experience under MS-DOS (which I'm guessing from the _dos_getvect() and _dos_setvect() references in your message).
Your problems with the compiler are deliberate choices on Microsoft's part. VC6 is designed to produce only executables that run in a Windows environment, so they saw no need to provide hardware access. You won't find library support for interrupts or port I/O. You can achieve these things using _asm blocks, of course, but that leads us to the next problem.
As a rule, the Win32 environment disallows hardware access by applications. Period. The purpose of this is to protect system integrity from ill-behaved applications. Now, there are differences depending upon which version of Windows you are developing for.
I've not programmed for it in a long while, but there may be enough of the DOS subsystem present to let you play with the interrupts under Windows 9x/ME. There are constraints, but I don't know if they completely prevent you from accessing the interrupt structure.
Under Windows NT/2000/XP, you are completely out of luck. NT and its successors reserve interrupt access to device drivers only. The best thing that will happen to your application if it tries to replace/intercept an interrupt is that it will terminate with an exception.
If you absolutely have to deal with hardware directly, you're going to have to learn about device drivers in the Win32 environment, which is distinctly non-trivial.
Software Zen: delete this;
|
|
|
|
|
I have a string specifying the user name in the format: "domain\username". My question is: How can I get the group to witch the user belongs to?
I searched API's but couldn't find anything all I could find was "LookupAccountName" but it is not what I'm looking for. Please help if you know something. Thank's
|
|
|
|
|
LookupAccountSid() is but one way. NetUserGetInfo() is another.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
This is good, but it seems to work only for local users. It doesn't work for a user on a diffrent domain for exaple if my computer name is "Station" and it belongs to the "LAN" domain and there is a user on the domain "LAN" called "globalUser" and a user on the local machine called "localUser", the function fill fail if I try to look up the user "LAN\globalUser". Even more, NetUserEnum() will not show the user called "globalUser".
|
|
|
|
|
I can use the following to get all users on my PDC:
LPUSER_INFO_0 pUserInfo = NULL,
pUserInfoTemp = NULL;
NET_API_STATUS nStatus;
DWORD dwIndex,
dwEntriesRead,
dwTotalEntries,
dwResumeHandle = 0;
CString strText;
nStatus = NetUserEnum(_T("\\\\tulsant"), 0, 0, (LPBYTE *) &pUserInfo, MAX_PREFERRED_LENGTH, &dwEntriesRead, &dwTotalEntries, &dwResumeHandle);
if (nStatus == NERR_Success || nStatus == ERROR_MORE_DATA)
{
pUserInfoTemp = pUserInfo;
if (NULL != pUserInfoTemp)
{
for (dwIndex = 0; dwIndex < dwEntriesRead; dwIndex++)
{
if (NULL == pUserInfoTemp)
break;
strText = pUserInfoTemp->usri0_name;
m_cbUserList.AddString(strText);
pUserInfoTemp++;
}
}
}
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Yes, this works fine for local users but I want to list even the users on other domains. It must be possible beacause in Win2000 when I go to "Control Panel\Users and Passwords\Add\Browse"
it shows me a list of all users on my domain but NetUserEnum() only enumerates the users that are stored on my computer.
|
|
|
|
|
The code snippet I provided is for iterating the userlist on the listed domain controller. If it is not working for you, something else is at play. How are you using the NetUserEnum() function?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
NetUserGetGroups or IADsUser::Groups
|
|
|
|
|
I want to do some printing randomly, each time print a single line.
When I use EndDoc() or Escape(ENDDOC), the printer ends a page.
How could I do printing like the POS terminal printer?
|
|
|
|
|
When printing, anything rendered to the printer HDC between calls to the StartPage()/EndPage() calls will be printed for that page (as long as its on the actual printable area).
So you would be doing something like:
StartDoc()
while (pages_to_print)
{
StartPage()
while (output_for_this_page)
{
print_a_line
}
EndPage()
}
EndDoc()
If you need to print like a terminal, you need to keep track of the current Y position on the page. After every line printed, you increment y value by the height of the line. When y > pageHeight, you end the current page and start a new one.
StartDoc()
while (pages_to_print)
{
StartPage()
y = 0
while (output_for_this_page)
{
print_a_line at 0,y
y += lineHeight
}
EndPage()
}
EndDoc()
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
But if I do not call EndPage() or EndDoc(),I could not get the line.
I want to see something printed when I print a line. How? Thank u!
|
|
|
|
|
StartDoc / EndDoc - designed to protect multipage documents from interspersed with others. PrintJob is suspended until EndDoc is called.
>How could I do printing like the POS terminal printer?
For remote spoolers - you can not, should not, and will not be allowed to; local - open device e.g. par port/usb and write directly. Even if local with direct write it still likely not work with most modern printers: laser printers, etc ....
Brian
|
|
|
|
|
Hi
I have the following problem:
I have a client where there is defined a network connection (mapping) to another computer. This is active when you double click the drive otherwise you see that red cross in the explorer just below the driveletter.
I have searched the web on how i can automatically restore the connection .. i have come accross the following link:
'http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wnet/wnet/wnetrestoreconnectionw.asp'
This is about the SDK 'WNetRestoreConnectionW'. There are almost no examples of using this SDK + this SDK won't work on Win95, 98 and Me computers.
Any good way of solving this problem?
Best regards
Jens
|
|
|
|
|
Considering all the desing guidelines of safe programming including exception handling, just wondering do we actually write the handler for each and every possible error/excepion in our code? Its certainly a good practice but how practical it is in terms of LOC that we put for handling the errors which may never occur as well.
Just consider this piece of code
LPTSTR l_strResConn = new TCHAR[NAME_LENGTH];
//check over the value
int l_nRet = LoadString(theApp->m_hInstance,....)
For every loadstring, I should check for the value of l_nRet. But practially in my code, I've just ignored it at every place.
|
|
|
|
|