|
About a month ago I found a dandy little article that demonstrated how to retrieve a Bitmap image from the clipboard.
The author created a single structure containing a BITMAPHEADERINFO and another structure (BITMAP?). This was mapped to the global memory data he got from the clipboard. He then was able to get an HBITMAP and HPALETTE and display the image.
The secret the author discovered was that Microsoft did not document that these are the two datastructures microsoft uses to put a bitmap on the clipboard.
I've searched everywhere. I'm sure I saw it here on the Code Project but I cannot find it now.
I've found some other articles on reading bitmaps from the clipboard. I want this one because it was so simple.
Thanks,
Sieg
Sieg_Heintze@yahoo.com
|
|
|
|
|
Was it this one?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Thank you to those who have helped me before. It has been a tremendous help. Because of you guys I was able to figure my errors and get done what I wanted to get done.
My new problem should be easy I just don't really know how to use what I got. I'm trying to format a edit box to display the currency symbol($) and set the precision that way my user(s) can't put in more then 2 after the decimal. (i.e. 12.333). I was reading this article and I was beganing to understand it but when I tried it out it didn't work. If anyone has any insight plz let me know.
http://www.codeproject.com/editctrl/ncpedit.asp#xx37605xx
Sincerely
David Berg
AIM- CaNorDBerG
email- quake3b@yahoo.com
|
|
|
|
|
MrNiceBerG wrote:
I was reading this article and I was beganing to understand it but when I tried it out it didn't work. If anyone has any insight plz let me know.
Perhaps the author could help?
There are plenty of other masked edit controls here.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi, I have a more general question to you VSS users:
How do you organize multiple projects with their header dependencies?
My main problem are some .lib projects that are used by some others. The initial decision was to "keep everything of one project together", so the lib with it's headers resides in one folder (e.g. Sources\Lib1) and the headers are shared to the Include folder.
That's fine until I have to work both on a lib header and a dependent project, in which case I need to "check in / get latest" the header after each modification. (or copy around manually)
How do you? Any tips?
Flirt harder, I'm a Coder
mlog || Agile Programming | doxygen
|
|
|
|
|
Where is the problem, during the compilation or linking?
Hope you are taking care different builds like release, debug etc
Still Alive!!!
Thank you God.
|
|
|
|
|
hi,
When WideCharToMultiByte is used for UTF-8 encoding it return garbage when called outside the context of the main thread. May be its not limited to UTF-8 encoding.
Any ideas???
Thx & Have a nice day
|
|
|
|
|
Most of the time when we say that there is a bug in the API, its usally that you are using the api in a wrong way.
Still Alive!!!
Thank you God.
|
|
|
|
|
|
Hey,
I'm trying to get some code here to compile and I'm having an issue. The "GetMinVal" method below should be defined as returning a const since it doesn't modify the underlying class. I also eventually need to access it from a
friend std::ostream& operator << (std::ostream&, const WT300_QaStateTable&);
method which will need for it to be a const.
My question is how do I make the following compiler error go away and still maintain "GetMinVal" as a const method.
Gotten using VC++ 2003, ver 7.1...
...\c2678_err.cpp(17): error C2678: binary '[' : no operator found which takes a left-hand operand of type 'const MAP_STR_STR' (or there is no acceptable conversion)
<br />
#include "StdAfx.h"<br />
<br />
#include <map><br />
#include <string><br />
<br />
using namespace std;<br />
<br />
typedef map<std::string, std::string> MAP_STR_STR;<br />
<br />
class c2678_err<br />
{<br />
public:<br />
c2678_err(void);<br />
~c2678_err(void);<br />
<br />
void SetMinVal(std::string key, std::string val) {mMinVal[key] = val;}<br />
std::string GetMinVal(std::string key) const {return mMinVal[key];}
<br />
private:<br />
<br />
MAP_STR_STR mMinVal;<br />
};<br />
<br />
c2678_err::c2678_err(void)<br />
{<br />
}<br />
<br />
c2678_err::~c2678_err(void)<br />
{<br />
}<br />
<br />
main()<br />
{<br />
c2678_err myProblem;<br />
std::string howMany;<br />
<br />
myProblem.SetMinVal("dogs", "02");<br />
howMany = myProblem.GetMinVal("dogs");<br />
<br />
cout << howMany;<br />
}
regards,
~Patrick
|
|
|
|
|
IIRC, map<>::operator [] cannot be used on a const map, since its used both for inserting and returning elements. It also returns a refrence to the value.
Maybe this will suffice?
std::string GetMinVal(const std::string& key) const
{
map<std::string, std::string>::const_iterator it = mMinVal.find(key);
if (it == mMinVal.end())
return (*it).second;
else
return "unknown key";
}
---
“Our solar system is Jupiter and a bunch of junk” - Charley Lineweaver 2002
|
|
|
|
|
if (it != mMinVal.end())
sorry!
---
“Our solar system is Jupiter and a bunch of junk” - Charley Lineweaver 2002
|
|
|
|
|
No worries, I saw that.
Thanks for the response. I totally missed that subscripting can modify that map, making it a non-const operation by definition. Ooops. Love it when the compiler doesn't let me blow my hand off.
thanks!
~Patrick
Code On!
|
|
|
|
|
Hi,
How to know whether or not "Internet Connection Firewall" is enabled or disbaled for any Network connection (In Windows XP & 2K). If anybody have sample code, please send it to me.
Thanks,
-Koti
|
|
|
|
|
Howdy my friends!
We have been developing Pocket PC solution for SAP R/3. But, we faced a problem with web service on .NET 2003. When I try to invoke method from VB.NET, return values don't set. Always "nothing". But, I can see the response SOAP message from SAP R/3 by MS SOAP Trace tool.
My sample code as below;
' Set RFC parameters<br />
Dim strPrm1 As String<br />
<br />
' Set URL<br />
Dim sURL As String<br />
sURL = "http://ybpent:8000/sap/bc/soap/rfc?sap-client=274"<br />
<br />
' Set credentials<br />
Dim m_Credentials As ICredentials<br />
m_Credentials = New NetworkCredential("xxxxx", "xxxxx")<br />
<br />
' Set web service<br />
Dim m_RfcGetTrustedSystemId As New dNETSOAP4SAPR3.RfcGetTrustedSystemId.RFC_GET_TRUSTED_SYSTEM_IDService<br />
m_RfcGetTrustedSystemId.Url = sURL<br />
m_RfcGetTrustedSystemId.Credentials = m_Credentials<br />
m_RfcGetTrustedSystemId.Timeout = -1<br />
<br />
' Call web service<br />
strPrm1 = m_RfcGetTrustedSystemId.RFC_GET_TRUSTED_SYSTEM_ID()<br />
m_RfcGetTrustedSystemId.Dispose()
Anybody has an idea about it?
Thanks.
Orkun GEDiK
|
|
|
|
|
woah what langauge is that , Greek?
Still Alive!!!
Thank you God.
|
|
|
|
|
My god! It must be in VB.NET. I'm very sorry.
|
|
|
|
|
hi i just began with visual c++ and i had programmed in just c++
and there the code was
ofstream output ( c:.....);
output >> int y
but i tried that in visual c++but it didnt work....
This is my code:
void CBr4turboDlg::OnOK()
{
// TODO: Add extra validation here
AfxMessageBox ( "F*** you");
CString szEdit;
m_editText.GetWindowText ( szEdit );
}
I have a member variable in my edit field and i want that 2 write 2 a text file??
|
|
|
|
|
so what's your problem ???
what error does the compiler returns (you said it didn't work...)
please be more explicit, otherwise, you'll stay alone with your empty text file...
TOXCCT alias Nicolas C.
|
|
|
|
|
I have searched every page for a code for writing a variable in a text file
|
|
|
|
|
Emm that was me above
|
|
|
|
|
If you write non-Unicode application, you should use simple
ofstream << (LPCTSTR)strName
With Unicode, it's more complicated, because STL doesn't provide generic text mapping, i.e. TCHAR's, LPCTSTR's etc. You could use your own mapping:
<br />
#if defined(_UNICODE)<br />
#define tstring wstring<br />
#define tofstream wofstream<br />
....<br />
#else<br />
#define tstring string<br />
#define tofstream ofstream<br />
#endif<br />
I use it in many of my apps and it works ok.
Robert-Antonio
"I launched Norton Commander and saw, drive C: on the left, drive C: on the
right...Damn, why I need two drives C:??? So I formatted one..."
|
|
|
|
|
Hi every body!
I have created a global hook function (in Dll) to capture Keyboard events. Every a key has been pressed, the hook function send a user-defined message to my application. My problem is:
My application can only receive the message, when it has focus.
Could you tell me why? And How can I correct it?
Thanks!
//Hook function
static LRESULT CALLBACK KeyboardHook(UINT nCode, WPARAM wParam, LPARAM lParam)
{
if( (nCode >=0) && (nCode == HC_ACTION) && (wParam == VK_SNAPSHOT))
PostMessage(hWndReceiver, UWM_CAPTURED,0,0);
return CallNextHookEx(hookKeyBoard,nCode,wParam,lParam);
}
//Message Map
BEGIN_MESSAGE_MAP(CTestHook, CDialog)
ON_REGISTERED_MESSAGE(UWM_CAPTURED,OnCapture)
//{{AFX_MSG_MAP(CTestDllDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//
afx_msg bool OnCapture(WPARAM wParam, LPARAM lParam);
xyz
|
|
|
|
|
Silly Boy wrote:
My application can only receive the message, when it has focus.
Does that imply that the PostMessage() statement is posting the message regardless of what window has the focus? If not, I'd be curious if any of the three conditions preceding the PostMessage() statement are evaluating to FALSE.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I am using PreCreateWindow in my MDI application and
have noticed that it gets called twice. The first time it gets called, the CREATESTRUCT has nothing in it (e.g. lpszName is null and so are lpszClass). The 2nd time it is called, I see information of my app in the lpszName and lpszClass fields of the CREATESTRUCT. Why is this being called twice (and with one call passing nothing to it?)?
|
|
|
|