|
Hi,
I have my Visual C++ 6.0 application Trial.exe & MS Acces databse table Trial.mdb
*) These steps I did try at my friend PC (Window 98 & without Jet DAO engine) as
article Q23002 suggested:
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q233002
1) Run MDAC_TYP.exe
2) Reboot PC
3) Jet40Sp3_Comp.exe
4) Reboot PC
5) Copy my Trial.exe Trial.mdb in c: drive as needed
6) Run Trial.exe & the PC said: "Can not initialize DAO Jet 4.0"
*) However, I did not perform those with Regsvr32 Dao360.dll in c:\Program
Files\Common Files\Microsoft Shared\DAO to become COM.dll ... because I am
not sure how to do it ! I did try do it in DOS environment c:\Windows\System
as Regsvr32 Dao360.dll), but the result is the same in (6)!
*) Do you think I need in DOS environment C:\Program Files\Common
Files\Microsoft Shared\DAO: "Regsvr32 Dao360.dll COM.dll"?
Can anyone help me, I need it for this afternoon!
Many thanks,
|
|
|
|
|
I'm having trouble with the LPBYTE param of this API.
I want to move text from my dialog based application to this api to send.
LPTSTR buffer;
m_cSendText.GetWindowText(buffer, 256);
nasStatus = NetMessageBufferSend(NULL,
awcToNameW,
awcFromNameW,
(LPBYTE)buffer,
256);
When I run my program all I get is a string of ?'s. How do I setup the 4th param so that it sends the text properly?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Okay I found that I did not have this set correctly is should be
CString buffer;
m_cSendText.GetWindowText(buffer);
nasStatus = NetMessageBufferSend(NULL,
awcToNameW,
awcFromNameW,
(LPBYTE)&buffer,
m_cSendText.GetWindowTextLength());
But I'm still getting junk in the message box. Any suggestions?
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
The problem is the unecessary & to take the address of the CString object. If you only need read access to the string data in a CString object, you can use the (LPCTSTR) conversion operator to get a pointer to the buffer. Then you'll have to use a cast, because NetMessageBufferSend() expects an LPBYTE rather than an LPCTSTR. That is, change
(LPBYTE)&buffer,
to
(LPBYTE)(LPCTSTR) buffer,
Casting away the constness of the LPCTSTR doesn't matter in this case, since NetMessageBufferSend () is only going to read the buffer.
Stephen C. Steel
Kerr Vayne Systems Ltd.
|
|
|
|
|
No this still does not work. I must not be setting something up right.
I have a dialog based app with 2 edit fields on it. And a control variables called:
m_cCompName.
m_cSendText.
LPWSTR awcToNameW;<br />
LPWSTR awcFromNameW;<br />
CString ComputerName;<br />
<br />
awcToNameW = T2W(ComputerName);<br />
awcFromNameW = T2W(ComputerName);<br />
NET_API_STATUS nasStatus;<br />
<br />
nasStatus = NetMessageBufferSend(NULL,<br />
awcToNameW,<br />
awcFromNameW,<br />
(LPBYTE)(LPCTSTR)TextSend,<br />
TextSend.GetLength());<br />
<br />
So what am I doing wrong. This should work. Right?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Usually NetXXX Api never use ANIS strings. Even if not explicitly mentioned in MSDN, I would try to convert the message buffer also to UNICODE.
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
That's what I ended up doing.
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
I want to know whether this is possible to access RAM through VC++? If yes then can i read or write data in RAM?
Please reply soon........
Samir Sood
|
|
|
|
|
Almost whatever you do in C++, you access RAM Of course you can only access memory managed by your process, otherwise your program will generate "Access violation" exception.
Vagif Abilov
MCP (Visual C++)
Oslo, Norway
Hex is for sissies. Real men use binary. And the most hardcore types use only zeros - uppercase zeros and lowercase zeros.
Tomasz Sowinski
|
|
|
|
|
You can access all memory mapped to application address space, randomly mapped to physical RAM by OS. If you need to access a physical RAM, you need to go down to driver level, if it's possible at all.
Pavel
Sonork 100.15206
|
|
|
|
|
Can u provide me with some api level information for it
Samir Sood
|
|
|
|
|
|
I have several constant variables that I want to use in my applications. What do you thing is best to define in a common header file?
#define VALUE 5
or
const int VALUE = 5;
?
Best regards,
Alexandru Savescu
|
|
|
|
|
using const is more C++ convenient. Also the debugger knows the value of the symbol. No overhead in resulting code.
But I'm used to #define, and it's hard to chnge the routine
Pavel
Sonork 100.15206
|
|
|
|
|
Pavel Klocek wrote:
using const is more C++ convenient
I thought so!
Pavel Klocek wrote:
But I'm used to #define, and it's hard to chnge the routine
Yes, so was I, no I am starting to change it and begin use const, or enums or static members in classes. This can also help hide some implementation details.
Best regards,
Alexandru Savescu
|
|
|
|
|
|
I agree. However, do you find macros useful? Or are they old fashioned and C-style (not c++)?
Best regards,
Alexandru Savescu
|
|
|
|
|
Alexpro wrote:
However, do you find macros useful?
Rarely. Sometimes they're useful for blocks of repeated code (a'la BEGIN_MESSAGE_MAP).
Alexpro wrote:
Or are they old fashioned and C-style (not c++)?
It depends who you ask
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
you should use inline functions rather than macros, there is more type checking and problems can be found ealier.
as far as #define or const int,
i'm not too sure of what the VC compiler does ( i'm pretty sure it gives an error ) if two global variables have the same name in an object file. But other compilers might just allow multiply defined globals which can be a nightmare to track down.
stick to #define for just numbers.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Generally, const is preferrable, as it adds some type safety and integrates well with the symbol linking mechanism. There's one caveat though: If you try to define a constant like this inside a class:
class A{
public:
static const VALUE=5;
...
}; VC++ complains, even though this is perfectly legal C++. The standard workaround is to define VALUE as an enum:
class A{
public:
enum {VALUE=5};
...
};
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Well this what I do when i define static values:
class A
{
static int VALUE;
};
and in the implementation file:
int A::VALUE = 5;
and it works!
Best regards,
Alexandru Savescu
|
|
|
|
|
Yes it works, but it has a drawback. A::VALUE , as so defined, cannot be used in constant expressions like this:
class A
{
public:
static int SIZE;
char array[SIZE];
}; The enum workaround does the trick, though.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
This is From Thinking in C++ book
------------------------------------
Constants
In old (pre-Standard) C, if you wanted to make a constant, you had to use the preprocessor:
#define PI 3.14159
Everywhere you used PI, the value 3.14159 was substituted by the preprocessor
When you use the preprocessor to create constants, you place control of those constants outside the scope of the compiler. No type checking is performed on the name PI and you can’t take the address of PI (so you can’t pass a pointer or a reference to PI). PI cannot be a variable of a user-defined type. The meaning of PI lasts from the point it is defined to the end of the file; the preprocessor doesn’t recognize scoping.
C++ introduces the concept of a named constant that is just like a variable, except that its value cannot be changed. The modifier const tells the compiler that a name represents a constant. Any data type, built-in or user-defined, may be defined as const. If you define something as const and then attempt to modify it, the compiler will generate an error.
You must specify the type of a const, like this:
const int x = 10;
In Standard C and C++, you can use a named constant in an argument list, even if the argument it fills is a pointer or a reference (i.e., you can take the address of a const). A const has a scope, just like a regular variable, so you can “hide” a const inside a function and be sure that the name will not affect the rest of the program.
The const was taken from C++ and incorporated into Standard C, albeit quite differently. In C, the compiler treats a const just like a variable that has a special tag attached that says “Don’t change me.” When you define a const in C, the compiler creates storage for it, so if you define more than one const with the same name in two different files (or put the definition in a header file), the linker will generate error messages about conflicts. The intended use of const in C is quite different from its intended use in C++ (in short, it’s nicer in C++).
------------------------------------
anju
|
|
|
|
|
Hi,
In a CListBox drived class i have a simple task: firstly
write something such as "do some work begin ..." in a listbox.
and then do some work and with a progressbar for show the
process. but here my problem is i don't know why the "do some work begin"
always shown at the end of the progress ?
I really want to show it before the start of the progressbar.
Thanks in advance!
chen
|
|
|
|
|
Try to call listbox.Invalidate() and listbox.UpdateWindow() before performing long operation.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|