|
helloo......great people......
i want to use "ObjectFromLresult" but problem is this:->
Windows 95/98/Me: Unsupported......
So what should i do??????? plz help me ASAP...
Thanx .
__________________________________________________________________________
keep smilling.....b'coz smile is the shortest distance between people....
|
|
|
|
|
The Redistributable line in MSDN Library documentation indicates that support for older operating systems is available by installing a redistributable library.
For this feature, use the Active Accessibility 2.0 RDK[^].
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
hi,
I have created one service called MyService. In this service, I want to
run an executable file which resides in Shared folder of remote
machine. i.e. \\COMP1\share\file.exe
For that I want to use CreateProcessWithLogonW() method.
In MSDN, it is mentioned that CreateProcessWithLogonW() is declared in
WINBASE.H. But when i searched WINBASE.H, it was not there.
Please help .
bhavesh
|
|
|
|
|
CreateProcessWithLogonW is only available on Windows 2000 and later. Visual C++ 6.0 predates Windows 2000. Download the latest Platform SDK[^].
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
How can i use picture controls?
|
|
|
|
|
u can use picture controlz to either put in pictures(non interactive tye) or use it to make ur own control,for creating graphic controlz.....
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
|
You have to be more specific.
What picture control?
JohnCz
|
|
|
|
|
Hi,
I wrote a function with variable parameters to do some log stuff in my project. The function prototype looks like this :
static void write(char* str,...);
What I wish to do is to link this function to a #define so that I can easily get rid of all my logs. The code should look like this :
<br />
#ifdef _DEBUG<br />
#define VCNLOG(x) write(x)<br />
#else<br />
#define VCNLOG(x)<br />
#endif<br />
<br />
VCNLOG("my value is %i",var);<br />
But this doesn't work due to the variable parameters (Visual complains about too much parameters in macro VCNLOG)
Any idea of how to get this work ?
thanks,
Ed
|
|
|
|
|
#ifdef _DEBUG
#define TEST test
#else
//#define TEST
#define TEST 0
#endif
void test(int, ...)
{
std::cout << "Hello, World from test() \n";
}
int _tmain(int argc, _TCHAR* argv[])
{
TEST(5, std::cout << "Hellow, World from _tmain! \n");
return 0;
}
Note that if
#define TEST
in Release mode, the test() function will never get called, but its parameters are get evaluated; so if you do not want this side effect, use:
#define TEST 0
Regards,
Serge
|
|
|
|
|
One solution:
static void write(char* str,...)
{
#ifdef _DEBUG
write to log file here
#endif
} Now all of the calls to write() can remain untouched.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
The following was based on how it is done in MFC (Afx.h):
#ifndef __MYTRACE_H__
#define __MYTRACE_H__
void MyTrace(int nLevel, LPCTSTR pFmt, ...);
#ifdef _DEBUG
#define MYTRACE MyTrace
#else
#define MYTRACE 1 ? ((void)0) : MyTrace
#endif
#endif // __MYTRACE_H__
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Yes, that is another way.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
ok, I'll try that. In fact the idea is not to include the parameters in the define...
What I don't understand is what it will do in release mode : 0(myparameters). This should crash, shouldn't it ? Or maybe there's something I missed in #define principle
thanks
Ed
|
|
|
|
|
Ed01 wrote:
What I don't understand is what it will do in release mode : 0(myparameters). This should crash, shouldn't it ? Or maybe there's something I missed in #define principle
The function gets called the same in release mode as it is in debug mode. The only difference is that the body of the function is "missing" in debug mode.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello Friends,
What is memory leak ?
How does it affects the cpp programs and how can memory leaks can be avoided using the virutal destructors ?
Hoping for are reply.
Yours,
Phijo
|
|
|
|
|
In my knowledge you can only create memory leaks when you don't use delete for every new .
When you use new , your program reserves some memory to store the object you're creating.
You have to manually release that memory (using delete ) so it can be used again.
If you don't you reserve more and more unused memory exhausting the cpu's resources.
It's one of the things you really, really don't do. If I see a big memory leak my reaction would be: and ! Memory leaks aren't always that easy to avoid though.
try to google for more info.
good luck.
only 1 thing to remember : for every new (including the ones in loops!) do a delete !
(equal: malloc , alloc : or something (don't use them myself))
No hurries, no worries.
|
|
|
|
|
Can someone point me in the right direction? I need to connect to:
a) connect to an instance of SQL Server using VC++ ( .NET ver ) The instance may or may not be on my local box. I need to some some simple queries from system tables (like sysobjects). Does my project need to be of a certain type? ( ie, when I create the project in Studio )
b) some method of moving through the rowset it returns.
I know that it would be easier in ado.net, but I don't have that luxury.
Any help would be appreciated!
|
|
|
|
|
you can accomplish these things with 2 MFC clasees
CDatabase and CRecordset
CDatabase Allows connection with a DSN ( supports DSN less connection too..)
yes you can create DSN s for remote machines. and you can connect via DSN.
Create A CDatabase Object
make a connection string
connect to database
create CRecordset object
set m_pDatabase member to your connected Database
submit the query to Recordset
the returned resultset is in ur recordset object itself
you can Extract them by using the GetFieldValue() member function
Ninety-eight percent of the thrill comes from knowing that the thing you designed works, and works almost the way you expected it would. If that happens, part of you is in that machine.
|
|
|
|
|
Hi,
could you tell me does vc++ can send email, if yes, how??
Thanks!
|
|
|
|
|
|
I saw tom.schultz's question,MDI Document with data from UDP.
I have the same problem too,so I want to ask,maybe stupid.
Can I do this,Class CDocEX : public CDocument ,public CWnd
or Class CDocEX : public CCmdTarget , which is a mixture of CDocument and CWnd.
then I can use SetTimer() and place MSComm in Document.
Thanks for any help.
|
|
|
|
|
You do not have to have window to set up timer. Use timer procedure and specify NULL for window handle.
Send command message from timer procedure and handle it in a document.
JohnCz
|
|
|
|
|
Hi,
I'm experiencing some problems with reading data from sockets. I have a thread that constanly reads(polls) data from the sockets port. Except it randomly hangs on on the recv() function. Is there something I'm doing wrong. Here is code sample.
Thanks
DWORD ThreadProc(LPVOID lparam)
{
char szBuffer[256];
while(1)
{
if(recv(socket, szBuffer, 256, 0)!= SOCKET_ERROR)
ParseData(szBuffer);
}
return 0;
}
|
|
|
|
|
do you mean the thread gets blocked on the recv() function if no data ? if yes, that's the expected behaviour:
If no incoming data is available at the socket, the recv call blocks and waits for data to arrive according to the blocking rules defined for WSARecv with the MSG_PARTIAL flag not set unless the socket is nonblocking. In this case, a value of SOCKET_ERROR is returned with the error code set to WSAEWOULDBLOCK. The select, WSAAsyncSelect, or WSAEventSelect functions can be used to determine when more data arrives.
Serge
|
|
|
|