|
|
Sorry, systray is not my problem
Dammy More
|
|
|
|
|
I am still struggling with this vector and COleSafeArray stuff.
can someone help me convert this
VB...
<br />
Dim tSA As SAFEARRAY2D<br />
Dim bDib() As Byte<br />
Dim cDib As New cDIBsection (which I have converted <a href="http://www.codeproject.com/bitmap/dibsection.asp?target=dibsection">to </a>[<a target=_blank title='New Window' href="http://www.codeproject.com/bitmap/dibsection.asp?target=dibsection">^</a>] m_DIBSection.Load(my.bmp); )<br />
With tSA<br />
.cbElements = 1<br />
.cDims = 2<br />
.Bounds(0).lLbound = 0<br />
.Bounds(0).cElements = cDib.Height<br />
.Bounds(1).lLbound = 0<br />
.Bounds(1).cElements = cDib.BytesPerScanLine<br />
.pvData = cDib.DIBSectionBitsPtr<br />
End With<br />
CopyMemory ByVal VarPtrArray(bDib), VarPtr(tSA), 4<br />
Later, JoeSox www.humanaiproject.org
"The worst fad has been these stupid little robots,
Graduate students are wasting 3 years of their lives
soldering and repairing robots, instead of making them smart.
It's really shocking." -Marvin Minsky.
|
|
|
|
|
Aha! Trying to port the classic VB DibSection code into C++, eh? Well, in C++, you can either use raw pointers, or you can use the SafeArray, just as VB does.
What's going on in the VB example:
'a 2D SAFEARRAY descriptor
Dim tSA As SAFEARRAY2D
'an array used to access the bitmap's bits
Dim bDib() As Byte
Dim cDib As New cDIBsection (which I have converted to [^] m_DIBSection.Load(my.bmp); )
'fill in the SafeArray descriptor struct
With tSA
.cbElements = 1
.cDims = 2
.Bounds(0).lLbound = 0
.Bounds(0).cElements = cDib.Height
.Bounds(1).lLbound = 0
.Bounds(1).cElements = cDib.BytesPerScanLine
.pvData = cDib.DIBSectionBitsPtr
End With
'copy the descriptor over the descriptor in the bDib SafeArray
CopyMemory ByVal VarPtrArray(bDib), VarPtr(tSA), 4
Partial C++ port:
SAFEARRAY2D* tSA;
tSA->cbElements = 1;
tSA->cDims = 2;
tSA->Bounds[0]->lLbound = 0;
tSA->Bounds[0]->cElements = cDib->Height;
tSA->Bounds[1]->lLbound = 0;
tSA->Bounds[1]->cElements = cDib->BytesPerScanLine;
tSA->pvData = cDib->DIBSectionBitsPtr;
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Dear All,
I am developing an application in MFC VC++ Version 6.0 for Windows 2000. I have made my application run as a service. I want to
run my program in safe mode also. But unfortunately my service doesnot starts in the safe mode and hence my appplication doesnot start.
How can I run my service run in safe mode also ?
Or is there any entry in the registry which shows that the system is in safe mode , and the system should run following set of programs at startup during safe mode.
Feel free to ask any further queries in this regards,
Thanks
Rohit Dhamija
|
|
|
|
|
I am developing using Visual C++6 (service pack 5) under Windows 98.
I have created a multi-monitor application, which works fine in the debug version (I put #define WINVER 0x0500 right at the start of my code, to enable Win98 & Win2K features).
In the VC6 IDE message pane, I get the following when I build:
NOTE: WINVER has been defined as 0x0500 or greater which
enables Windows NT 5.0 and Windows 98 features. When these
headers were released, Windows NT 5.0 beta 1 and Windows 98
beta 2.1 were the current versions.
For this release when WINVER is defined as 0x0500 or greater,
you can only build beta or test applications. To build a
retail application, set WINVER to 0x0400 or visit
http://www.microsoft.com/msdn/sdk to see if retail Windows
NT 5.0 or Windows 98 headers are available.
The problem is, I want to create a release version (I need to do some speed optimisation of the inner loop!)
I read the info in www.codeproject.com/cpp/cppforumfaq.asp, para 2.2, _BUT_ the SDK updates are not applicable to Windows 98.
To summarise - how do I update the header files, and presumably some library files and whatever else is necessary, to let me generate a release version under Windows 98?
|
|
|
|
|
You probably just need to install the latest platform SDK.
To be perfectly honest, everyone should
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
I tried that (without reading all the information as well as I should!)
The information on PSDK says:
The applications you develop with this edition of the SDK
can run on the Windows Server 2003, Windows XP, Windows
2000, Windows NT®, Windows Millennium Edition, Windows 98,
and Windows 95.
So I downloaded, installed, and tried to compile my application. I got a message something like "RC.EXE wrong version. Install a later version of Windows." So I went back to the MS SDK page, and when I checked, saw:
SYSTEM REQUIREMENTS
The SDK requires Microsoft® Windows® XP, Windows 2000,
Microsoft Windows NT® 4.0 SP6, or Windows Server 2003.
The SDK is not supported on Windows 95, Windows 98, or
Windows Millennium Edition.
But the installer does not check Windows version - it happily installs on Windows 98. The un-installer won't remove the PSDK, either!
|
|
|
|
|
You can still install the PSDK. WHen you use the "Register PSDK Directories with Visual Studio" menu item to set up the include/lib/bin paths in VC 6, you'll need to go remove the BIN entry from the executable search path. This way you'll use the VC 6 compiler/linker/RC, instead of the PDSK ones which are crippled and won't run on 9x anymore.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
Thanks - I will try and report the results.
I may have problems because I tried to uninstall, but we'll see. If necessary I will install again.
The Microsoft SDK_bin and Microsoft SDK_lib directories have Win95 subdirectories - any suggestions what to do about the contents of those?
|
|
|
|
|
Thanks to Michael Dunn for the assistance.
I now have a Visual C++ 6 project with WINVER = 5.0 (Windows 98 / Windows 2000 - specific features enabled) and I can build a release version.
For others with the same problem, I did the following:
* I installed the latest platform SDK from the Microsoft MSDN site.
* I ran:
Start Menu/Programs/Microsoft Platform SDK February 2003/Visual Studio Registration/Register PSDK Directories with Visual Studio
* In Visual Studio 6, I went into Tools / Options / Directories / Executable files, and deleted " C:\Program Files\Microsoft SDK\bin" from the list.
I hope this helps others in the future.
|
|
|
|
|
I'm handling the notification message of TVN_EXPANDING in an OnItemexpanding method of a CTreeView based view. The structure passed to the method contains two members called itemOld and itemNew. From some limited testing it seems that itemNew contains valid stuff, so what the heck is itemOld all about for this message? Thanks.
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
Oh and for those that ask programming questions in the lounge. Seek the truth here[^].
|
|
|
|
|
Some messages give you info on two nodes at once, eg TVN_SELCHANGING . The notifications that only deal with one node use only one (although not all such messages use the same TVITEM struct; it would've been nice to have standardized behavior)
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
I started a thread in the C# section about the PushSource example in DirectX\DirectShow\Filters which could be used to re-create a video stream from a series of bitmaps...
At the moment I'm trying to figure out how to pass bitmaps directly to the PushSource code rather than it pulling in files from the hard drive.
I'm wondering whether the Grabber example could be thrown in reverse. Instead of it's callback function notifying when a fresh grab is ready in the buffer the callback function makes a request to fill the buffer with a bitmap.
My main code is capturing a series of frames as single bitmaps and it would be nice be able to feed them straight into DirectShow/PushSource to render or write out to a file.
As I'm rubbish at C++ could anyone suggest a better way of approaching this problem?
Best Regards,
Andy
------------
God created the universe in 6 days and has been debugging ever since - welcome to the biggest ever beta test
|
|
|
|
|
Is it possible to hide and show a tree item ?
When I mean to hide, I do not mean to collapse a branch and make an item invisible.
I could not find a solution so far.
Orcun Colak
|
|
|
|
|
What do you mean hide then? Do you mean disable an item?
Kuphryn
|
|
|
|
|
I mean something like this:
Assume there are 3 items in the tree
Item1
Item2
Item3
I would like to hide item2 and have a tree like this
Item1
Item3
Then sometime later I would like to bring the tree to its initial state.
I was wondering if is this possible or do I have to delete the items and then insert them back to simulate a hide/show item effect.
Thanks
Orcun Colak
|
|
|
|
|
orcun colak wrote:
I was wondering if is this possible or do I have to delete the items and then insert them back to simulate a hide/show item effect.
That is the only way I am aware of with the MS tree ctrl.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
It should be possible, but it isn't yet. I'm the leader of a new project to redo the Windows controls from scratch. It started out as a project on CP[^], but it will soon be moving off of CP, to its own site, and will be called the Fluid UI Toolkit. We are wanting to make a new set of controls from scratch, and avoid the limitations of the current Windows controls.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Background:
This function allegedly allows one process to collect information about the memory usage of other processes.
The (only) Microsoft sample code using this API seems to be a sample debugger that spawns a process under debug and then uses the API.
In true MS fashion, the documentation talks about about using OpenProcess to get a handle to another process and then using that handle in the call to VirtualQueryEx. There is no mention that you must be DEBUGGING the other application.
In some tests cases so far, I get access violation trying to OpenProcess, but assuming that succeeds, the error code is 'invalid parameter' on return from VirtualQueryEx. I know the other parameters are valid, so I am assuming it is a form of access denied.
The Problem:
Unless you are on Windows XP or later. You can not seem to attach to a process to debug and then detach without stopping the process which was being debugged. Not good for our application.
The Question:
Has anyone got this to work to spy on other process memory without 'debugging' the other process?
|
|
|
|
|
try it like this:
HANDLE hProcess;
MEMORY_BASIC_INFORMATION mem;
hProcess = OpenProcess( PROCESS_VM_OPERATION, FALSE, id );
VirtualQueryEx( hProcess, 0x00400000, &mem, 4 * 1024 );
this has to work... debugging is not nesassary
Don't try it, just do it!
|
|
|
|
|
Two things so far.
1. I do not think this is correct anyway:
VirtualQueryEx( hProcess, 0x00400000, &mem, 4 * 1024 );
Should probably be:
VirtualQueryEx( hProcess, 0x00400000, &mem, sizeof(MEMORY_BASIC_INFORMATION) );
which now works fine.
2. Why can I only query virtual memory usage from 0x00000000 to 0x7FFE0000 ?
Reading from 0x7FFF0000 causes 'invalid parameter' to be returned from GetLastError().
I REALLY want to make a map of memory usage between 0x80000000 to 0xFFFFFFFF.
Why are these memory ranges out of bounds? That is the range where the memory mapped files and shared memory between applications are usually located, and it is still initially aquired by a process using the VirtualAlloc calls.
|
|
|
|
|
Is it possible to append a status bar to to a property sheet?
BOOL CMyPropertySheet::CreateStatusBar()<br />
{<br />
static UINT nIndicators[] = <br />
{<br />
ID_SEPARATOR,<br />
IDS_TIME<br />
};<br />
<br />
if (!m_bar.Create (this))<br />
return FALSE;<br />
<br />
m_bar.SetIndicators (nIndicators, 2);<br />
return TRUE;<br />
}
The above function is called from the OnCreate() function of my PropertySheet but it fails to appear. Any ideas?
|
|
|
|
|
Hi All,
I'm new to programming, so i have been trying to read and go to a few classes.
I have been reading the tutorials on Server/Clients and am still a little confused.
Right now i have a dialog that has a couple of check boxes on it, and I want to send the information of whether the boxes are checked or not to the server side . The message is just a string that looks like this : 2000 or 2001
I know that the two connect, but I can not get the message to be sent to the server. I am using the command:
send (socket, buf,strlen(buf),0)
where socket is instantiated in another dialog class that i use to connect to the server. How do I use the same socket that is already connected to the server to send this message. It won't compile unless i instantiate another socket in the dialog class with the check boxes.
Many thanks in advance.
|
|
|
|
|
Under winsock, the program calls Win32 API to access the socket. If you wanted to send data on one object and receive data in another object, then one solution is to pass the socket.
Kuphryn
|
|
|
|