|
e.g BSTR bstrValue
_bstr_t bstrTemp(bstrValue);
CString sValue = (LPCTSTR)bstrTemp;
|
|
|
|
|
Use MAKELONG(hAtom, 0) where hAtom is your ATOM value you got from RegisterClassEx.
Look! They have the Internet on computers now! (Homer J. Simpson)
|
|
|
|
|
no problem, always happy to help
If a train station is where the train stops, what's a workstation...?
|
|
|
|
|
Just cast it to a LPCTSTR like so: (LPCTSTR)MAKELONG(...)
If a train station is where the train stops, what's a workstation...?
|
|
|
|
|
adrian cooper wrote:
while(beerInFridge()) {
You should make this a member of CKitchen and get a instance, instead of a global function. You might get the beerlevel of some foreign fridge. (besides of a possible beerleak)
...make it about Visual C++, and don't ever mention Visual Basic. Nick Hodapp (MSFT) in Semicolon[^]
|
|
|
|
|
When I use VB.NET to call a 'C' dll. It displayed error as follow
ERROR
=====
"Object reference not set to an instance of an object."
'C' FILE (Not C++, so hasn't used _stdcall)
===========================================
BOOLEAN WINAPI PacketGetAdapterNames(PTSTR pStr,PULONG BufferSize)
'DEF' FILE
==========
EXPORT
PacketGetAdapterNames
In VB.NET
=========
Private Declare Function PacketGetAdapterNames Lib "packet.dll" (<marshalas(unmanagedtype.lpwstr)> ByVal lpBuf As String, <marshalas(unmanagedtype.u8)> ByVal BufferSize As Long) As Boolean
.
.
lSuccess = PacketGetAdapterNames(Name, Size)
.
It display error.
More investigation
==================
I try to use "LoadLibrary" and "GetProcAddress" to test its existence. It hasn't reported error.
I also write another routine in C++ with same argument, no error.
So, any ideas on how to call this 'C' routine in VB ?
Danny
|
|
|
|
|
Hi,
I have a long string which is obtained from the other class.
Now i want add this string into my ListBox in main dialog.
I can get the string but it cannot be added as i expected.
The problem is how to splite the string with separate point
"\\"?
My string looks like :
"this is one \\ this is two \\ this is three \\ ..........."
The expected format when added the string into listbox should be:
This is one
this is two
this is three
..........
Thanks in advance!
chen
|
|
|
|
|
Split up the string using strtok() or the Tokenize() CString member if you're using MFC.
Look! They have the Internet on computers now! (Homer J. Simpson)
|
|
|
|
|
Here's an example: I get the CLSID of the program using CLSIDFromString, how do I get the version number?
Jonathan de Halleux, Belgium.
|
|
|
|
|
First of all, interfaces don't have version numbers, they are supposed to be immutable. You can get the version of the executable that implements the interface by using the GetFileVersionInfo and related APIs.
Look! They have the Internet on computers now! (Homer J. Simpson)
|
|
|
|
|
Thks
Jonathan de Halleux, Belgium.
|
|
|
|
|
Hello world!!!
I want to execute a last *.exe file (or *.bat) when I shutdown the OS (win2k).
How to do that???
Thank in advance...
Hello World!!!
from Raphaël
|
|
|
|
|
Write a NT service, and do a shell execute when you receive the WM_QUIT message (which is what is sent by the OS if I remember well).
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
That's a good idea... Thanks...
Hello World!!!
from Raphaël
|
|
|
|
|
Hi !!
I am new to windows programming. I've created a dialog box and placed a static control on it. The static control displays the numeric value of an int variable. So simple . Now here is my problem: Two worker threads are associated with this program and are changing the value of that variable. The variable was passed as a reference to these threads. Now what i want is that whenever the thread changes the value of variable, its new value gets updated on the static control. How can i do that ???
|
|
|
|
|
Your threads can generate a message (see WM_APP or RegisterWindowMessage) whic is caught by your main app, which updates your variable. The CStatic would show the new value after a UpdateData().
|
|
|
|
|
I'm using the WebBrowser control to display some XML file.
Do you know how could i programmaticaly select the text between two distinct positions from the file?
rechi
|
|
|
|
|
If you have the XML file and are using C++, what you can do is override the default XSL stylesheet applied by IE when the XML content is rendered. To get the default XSL code, type res://msxml.dll/defaultss.xsl in your browser.
If you are an interactive user, you may find useful to select a region based on the current html tag under the mouse cursor. For instance, in Javascript, I have a onmouseover event handler implemented like this :
var elem = window.event.srcElement;
var rng = document.body.createTextRange();
rng.moveToElementText(elem);
rng.select();
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
Thanx a lot for your advice!
The case: i have a fragment from the XML text and i want to highlight it.
Your first suggestion seems to be more appropriate but unfortunately i'm not familiar with XSL and it's gonna take some time. How could i change the default one?
Are there no other possibilities but these two?
rechi
|
|
|
|
|
Bogdan Rechi wrote:
How could i change the default one?
You've got to add this <?xml-stylesheet type="text/xsl" href="show_book.xsl"?> just below the <?xml version="1.0"> header of your Xml file.
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
I'll try to do it this way.
Thanx again.
rechi
|
|
|
|
|
I want to send ALT + S to an application, ive tried:
PostMessage ( hHandle , WM_SYSCHAR , 's' , 0 );
What im i doing wrong cos its not working
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Try passing 0x20000000 as lParam value. According to the docs, that defines the ALT key as being pressed.
Look! They have the Internet on computers now! (Homer J. Simpson)
|
|
|
|
|
PostMessage ( hHandle , WM_SYSCHAR , 's' , 0x20000000 );
didnt work? Why?
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
See SendInput, keybd_event.
|
|
|
|