|
Probably you have to change the following lines
CString str='s';
m_UserVariable.Processattendacne(str);
to something similar to (error checking omitted)
BSTR bstr = SysAllocString(L"s");
m_UserVariable.Processattendacne(&bstr);
SysFreeString(bstr);
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[Image resize DLL]
|
|
|
|
|
Thanku very much..User technich is working properly...now i am inspered by you to learn more new things..
Please will u tell me how to take record set data from ocx and send to ocx..
in activex it is like this :
void C_UserControl11::Processattendacne(LPDISPATCH* rs, LPDISPATCH* rs1, BOOL* blnprocess)
{
static BYTE parms[] =
VTS_PDISPATCH VTS_PDISPATCH VTS_PBOOL;
InvokeHelper(0x60030000, DISPATCH_METHOD, VT_EMPTY, NULL, parms,
rs, rs1, blnprocess);
}
please tell me how to do this...
give me some suggestions please...
It is very helpful for me...
Thanks aLot..
Savitri
|
|
|
|
|
I have this question. I'm an Info Tech student in Uni. We were assigned to a project that involves audio.
We wish to write a new audio encoder which transforms/encodes an mp3 file to a custom format, say *.btm.
And also a plug-in which will be able to decode the *.btm file and is compartible with any media player as long as the plug-in is there.
I was wondering if you could give me a tip on how it works and how to go about it.
We are working on a school project with my team mates.
Please i would appreciate it if you send me some helpful codes (C++) as well.
Thanx you.
Samson Akanet.
|
|
|
|
|
Try to search http://sourceforge.net[^] with the name lame. This is a library for converting mp3 files and is, for sure, in source code.
|
|
|
|
|
Thanks alot, it was helpful
|
|
|
|
|
Hi,
The CSocket class has been widely publicised as being buggy: the advice has historically been to use a 3rd party control or write your own.
Has the CSocket class with MFC supplied with VS2008 been updated, or is the current advice to use a 3rd party control / write your own?
Can anyone reccommend a 3rd party / free TCP wrapper? (Yes I'm aware there are plenty of example applications here on CP, but which one is the best)
thanks,
Mark.
|
|
|
|
|
|
I don't know how buggy it is - it does what it's documented to do.
It's a very simple designed wrapper around the Winsock APIs. It
works fine for simple socket tasks (on one thread).
If you need performance you'll need asynchronous communications.
You can use the CAsyncSocket - it works pretty well and it's a very
thin wrapper around the socket APIs so you could use straight APIs
almost as easily.
The important thing is to know how sockets work and how to use the APIs.
Then the MFC classes will make more sense and you'll be able to use them
effectively. The source code for those classes is the ultimate documentation,
and it's relatively easy to read.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I am trying to set 404 custom error page on windows 2003.
then I restarted the IIs but it fails
In IIS
1. I am selecting the properties of the website
2. selecting Custom errors Tab
3. Then selecting the new custom error page
4. then restarting the IIS
But This procedure fails ...
pls help me
|
|
|
|
|
i have wrote code logon admin in limited user like the following
****************************************************************
BOOL CEKLoaderDlg::OnLogonUser()
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
HANDLE hToken;
LPCTSTR lpszPrivilege = "SeTcbPrivilege";
BOOL bEnablePrivilege = TRUE;
BOOL bDisEnablePrivilege = FALSE;
LPDWORD lpExitCode;
char* username = "administrator";
char* password = "xxx";
char* cmdLine = "cmd.exe";
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
static LUID luid;
static TOKEN_PRIVILEGES tp;
if(!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken))
{
AfxMessageBox("OpenProcessToken() error \n");
}
else
// AfxMessageBox("OpenProcessToken() is OK\n");
//********************* Enabling (Disabling) privilege ***************************
// Call the user defined SetPrivilege() function to enable privilege
if( SetPrivilege(hToken, lpszPrivilege, bEnablePrivilege))
{
if(LogonUser(username,".",password,LOGON32_LOGON_INTERACTIVE,LOGON32_PROVIDER_DEFAULT,&hToken))
{
if(ImpersonateLoggedOnUser(hToken))
{
if(CreateProcessAsUser(hToken,0,cmdLine,0,0,FALSE,NORMAL_PRIORITY_CLASS|CREATE_NO_WINDOW,0,0,&si,&pi))
{
// editbootini();
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
TerminateProcess(hToken,0);
return TRUE;
}
else
{
AfxMessageBox("Failed");
}
// Cleanup...
if( pi.hProcess != NULL )
CloseHandle( pi.hProcess );
if( hToken != NULL )
CloseHandle( hToken );
}
}
else
{
AfxMessageBox("Administrator password is wrong");
exit(0);
}
}
SetPrivilege(hToken, lpszPrivilege, bDisEnablePrivilege);
return TRUE;
}
Then wrote code for restart like the following
*********************************************
m_stcCalling.SetWindowText("Restarting Your System");
AfxEnableControlContainer();
HANDLE hToken; // handle to process token
TOKEN_PRIVILEGES tkp; // pointer to token structure
BOOL fResult;
if (!OpenProcessToken(GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
*******************************************//return failure
{
log("Error Type : Error in Restarting");
log("Severity Level : Critical");
return FALSE;
}
// Get the LUID for shutdown privilege.
LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME,
&tkp.Privileges[0].Luid);
tkp.PrivilegeCount = 1; // one privilege to set
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
// Get shutdown privilege for this process.
AdjustTokenPrivileges(hToken, FALSE, &tkp, 0,
(PTOKEN_PRIVILEGES) NULL, 0);
fResult =InitiateSystemShutdown(NULL, "System is being restarted ", 0, TRUE, TRUE);
if (!fResult)
{
fResult = GetLastError();
log("Error Type : Restarting Failed");
log("Severity Level : Critical");
return FALSE;
}
return 1;
}
But restart wont done .why?
|
|
|
|
|
Please indent the code and use appropriate tags for the code blocks. It is very difficult to read your code.
Regards,
Sandip.
|
|
|
|
|
What function is failing? Have you bothered to use the debugger to find out what is going on?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
When I delete the code of a class's menber function, the class view cann't flash, why?
Thanks!
|
|
|
|
|
Why would the "class view" flash?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi all,
I have made a application on VC-2005. Now my problem is its not working on windows-2003, i.e when i click on exe nothing happens...
Why my exe is not working on windows-2003...
Can anybody help me in this?
Thanks in advance
|
|
|
|
|
|
|
Try installing it. That installation is necessary if we want to run a VS 2005 exe in a OS where Visual studio 2005 is not installed.
Also confirm that you are trying to run the release version of the binaries.
|
|
|
|
|
Naveen wrote: That installation is necessary if we want to run a VS 2005 exe in a OS where Visual studio 2005 is not installed.
Isn't it sufficient to create an installation along with necessary dlls found in the Program Files\Microsoft Visual Studio 8\VC\redist\x86 folder?
Have you tried out this way? Just curious.
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
I havent tried that way. Since those binaries are implemented as side-by-side assemblies, I guess it will be little difficult to include them in the installation.
|
|
|
|
|
I am making a chat application. I need to send & recieve emoticons/smileys. I am getting their codes. What to do to retireve the smileys properly
Thanks In advance
Dhiraj
|
|
|
|
|
What do you mean exactly ? Emoticons are just a specific combination of symbols (e.g. : and ) ). Those symbols are then interpreted by your application and replaced by a small image representing the emoticon. But you have to do that yourself.
|
|
|
|
|
Thanx! I will try to do it.
|
|
|
|
|
Hi all,
I have made a simple text file using CStdioFile object and writing and reading strings using that file and saved it using different file extension suppose .ehn. Now i want to hide this file i.e it must be shown when i click on folder option show hidden files and folder...
how can i do this......
thanks in advance
|
|
|
|
|
Use the api - SetFileAttributes() by passing FILE_ATTRIBUTE_HIDDEN as parameter.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|