|
m_myclass.Draw(dc,m_memdc); // First draw to memory DC???????????
Why parameter 2 is a DC
-----------------
conglt
|
|
|
|
|
The problem is you did not selected any bitmap to the memdc.
CreateCompatibleDC will create a dc with 1x1 pixel wide bitmap. So you have to create a bitmap also. See the example.
CPaint dc( this );
CDC dcMem;
dcMem.CreateCompatibleDC( &dc );
CBitmap bitmap;
bitmap.CreateCompatibleBitmap( &dc, width, height );
CBitmap* pOldBitmap = dcMem.SelectObject( &bitmap );
//
// Draw
//
dc.BitBlt( 0, 0, width, height, &dcMem, 0, 0, SRCCOPY );
dcMem.SelectObject( pOldBitmap );
GoodLuck!
- NS -
|
|
|
|
|
Thanks a lot, it works!
Lisoft
|
|
|
|
|
Dear Friends,
I try to work with TAPI3.0 that is COM based, so in create an COM object it returns "CoCreateInstance on TAPI failed"
<br />
ITTAPI *TObj;<br />
HRESULT hr;<br />
hr = CoCreateInstance(<br />
CLSID_TAPI,<br />
NULL,<br />
CLSCTX_INPROC_SERVER,<br />
IID_ITTAPI,<br />
(LPVOID *)&TObj<br />
);<br />
if ( FAILED(hr) )<br />
{<br />
MessageBox("CoCreateInstance on TAPI failed");<br />
}<br />
is there any one help me ?
|
|
|
|
|
What is the hr result when CoCreateInstance Fails?
look the result in the error lookup.
hope this helps
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
it says in HRESULT "CoInitialize has not been called."
|
|
|
|
|
There ya go
in order to call CoCreateInstance, you need to load the COM libraries. this is done by
CoInitialize method (check out MSDN for more information)
don't forget to call CoUninitialize when done using the COM libraries
good luck
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Dear Friend,
It is true i must do CoInitialize, i have forget it. Thank u
|
|
|
|
|
How to install OpenGl to VC++6.
What are various lib, bin, etc files required and
where i have put it in VC++ 6 .
-- modified at 3:02 Monday 17th April, 2006
|
|
|
|
|
Go to project settings>link and then search for the Object/Library Modules
Add the following entries to the end of the text box in the line
Opengl32.lib glaux.lib glu32.lib
Now in the file whereyou are using open gl functions,include the two files given underneath
#include "gl/gl.h" <br />
#include "gl/glu.h"
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
-- modified at 4:01 Monday 17th April, 2006
|
|
|
|
|
Check out this:
http://www.airport1.de/opengl.htm
Cheers
"Peace of mind through Technology"
|
|
|
|
|
nehe.gamedev.net, a site is very good for programming with OpenGL & VC++
-----------------
conglt
|
|
|
|
|
Hi,
I have created a List Control. I have to add the text by default by which the user can modify the text as required.
List control ID :- IDC_EXCLUDE_FILTERS_LIST
Type :- CListCtrl
Member :- m_EXCLUDE_FILTERS_LIST
I have to add the folowing text by default when the Dialog window loads.
*.exp *.ilk *.res *.trg *.tlh *.idb
*.pdb *.pch *.opt *.lib "*\Deleted
Items\*" *.cab *.mov *.mp3 *.swf
*.psp *.bmp *.chi *.chm *.com *.dll
*.exe *.gif *.hlp *.ivi *.ivt *.ix
*.jpeg *.jpg *.msi *.nl.mpeg *.mpg
*.ram *.rm
Can anyone please tell me how to add the default text to the list box & also user can edit the text and also remove the text..
I dnt know properly that i have to Edit Box or List box. but the text should be
multiple lines where the user can edit the text.
Regards,
Parichay.
|
|
|
|
|
hai parichay
for this u can use combo box instead of list box or edit box where u can enter the list before and u can edit while runtime
|
|
|
|
|
Hi,
Thanks for the reply..
But in the Edit box , how to display the text in multiple line ???
|
|
|
|
|
hai parichay
to display mutliple lines u can set the property of the edit box as follows
in the edit box properties->styles->mutliline checked
|
|
|
|
|
I just create a edit box with m_EDIT member of Type CString also checked multiline and i declared
m_EDIT = "*.exp *.ilk *.res *.trg *.tlh *.idb *.pdb *.pch *.opt *.lib "*\Deleted Items\*" *.cab *.mov *.mp3 *";
i am gettling lots of erro that i cant use * etc can u please tell me how to do it?
--------------------Configuration: DesktopSearch - Win32 Debug--------------------
Compiling...
UpdateDlg.cpp
D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2017: illegal escape sequence
D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2065: 'Deleted' : undeclared identifier
D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2017: illegal escape sequence
D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2296: '*' : illegal, left operand has type 'char [61]'
D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2146: syntax error : missing ';' before identifier 'Items'
D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2065: 'Items' : undeclared identifier
D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2297: '*' : illegal, right operand has type 'char [21]'
Error executing cl.exe.
DesktopSearch.exe - 7 error(s), 0 warning(s)
|
|
|
|
|
Use \\ for getting a single \
- NS -
|
|
|
|
|
keerthikaaa i cant use the Combo Box, i can use Edit box or list control or list Box.
|
|
|
|
|
hai parichay
look at this link.it may help u
www.codeproject.com/listctrl/listctrldemo.asp
|
|
|
|
|
parichaybp wrote: I have created a List Control. I have to add the text by default by which the user can modify the text as required.
I've no idea what you are trying to say here.
parichaybp wrote: I have to add the folowing text by default when the Dialog window loads.
What do you mean "by default?" What control do you want this text added to? If it's a list control, please explain in more detail as that control can be displayed in many different formats (e.g., report, list, icon).
parichaybp wrote: Can anyone please tell me how to add the default text to the list box
Now you are using a listbox?
parichaybp wrote: ...also user can edit the text and also remove the text..
Do you need an edit control for this?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hey folks:
I've got a nice C++ STL string and I need to turn it into a TCHAR.... (and I can't use MFC)
I've tried:
typedef std::basic_string< TCHAR > tstring;
and it doesn't work (or it does, and I don't know how to use it) ... basically how do I convert these types?
Thanks!
-- modified at 2:07 Monday 17th April, 2006
|
|
|
|
|
typedef std::basic_string< TCHAR > tstring;
is the correct syntax for changing a STL string to TCHAR
Now when you want to change the string to tstring you can use
tstring("ABCXYZ"); that's all
I hope this works fine at your end but there may be some other problem in the way you are using this code.Please specify how you are using the code.
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
|
|
|
|
|
So I have the following header, but basically, I have a STL string that I want to convert to tchar, to call Win32 APIs... (that require the use of LPTCSTRs) when I try your suggestion:
tstring blah = tstring("ABCXYZ");
I get the error:
error C2440: '<function-style-cast>' : cannot convert from 'const char [7]' to 'tstring'
Could you provide a more elaborate example? Thanks!
#include <windows.h>
#include <stdio.h>
#define NULL 0
#include "LogFiles.h"
#include "TestPrint.h"
#include <string>
#include <iostream>
#include <conio.h>
using namespace std;
typedef std::basic_string< TCHAR > tstring;
|
|
|
|
|
Lots of helper functions here[^] (look for toWideString()).
0 bottles of beer on the wall, 0 bottles of beer, you take 1 down, pass it around, 4294967295 bottles of beer on the wall.
Awasu 2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|