|
i have 2 modeless dialog boxes (in same app), on each i display some pictures (16*16 pixels) - they are just pictures by DC (not windows).
i need to drag a pic from one dialog to another. i check mouse down on which pic then start drag. then use mouse move and mouse up (set capture) for drop.
i think it is possible to have better messages instead of simple mouse events even in this case.
do u have better idea?
thx
includeh10
|
|
|
|
|
for some reasons, i need to create a CBitmap from buffer, the buffer is OK (BITMAPINFOHEADER+RGBQUADs+bitsBuf) because i display the buffer properly by StretchDibits function.
now i try to create CBitmap from it.
use CBitmap.CreateBitmapIndirect((BITMAP*)pBuf).
pBuf=BITMAP+bitsBuf. return value and size of the bitmap checked OK, but when select it into memory DC then BitBlt to client DC (all return values are OK), i see nothing.
do u know what is wrong?
and, why pBuf doesn't have color table?
Note: the CBitmat will be used in CToolBar (AddBitmap), so no DC should be involved.
thx.
includeh10
|
|
|
|
|
see CreateDIBitmap or CreateDIBSection
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
I have a pdf file. I know there exists software
out there that lets me print on top of the pdf
file. Isn't there any way of printing user
text and a pdf file together so that text is
printed on top of that file?
I can convert the pdf to a bitmap and print text
with a bitmap easily. Unfortunately, the bitmap
does'nt print clearly. Isn't there a way to
print the pdf by a dos command and before that page goes to the printer, send some text with it so that it prints together?
Please, any response any one can give me will be greatly appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
I'm trying to have my EXE pass an WM_PAINT message to a dll with no luck. The last idea I had was to use the following
m_SpellCastingBar.SendMessage(WM_PAINT);
however this did not work as well. I have tried Invalidating the rectangle however I'm not sure if I'm even reaching the dll with this call as the WM_PAINT message is not getting retrieved by the dll.
Might there be something I am missing?
Thanks!
"Why are we hiding from the police, Daddy?"
"We use VI, son. They use Emacs."
|
|
|
|
|
You should not pass WM_PAINT messages to windows. Windows will ignore them anyway. Windows only generates paint messages itself if the message queue for that thread is empty. Even then the target window needs to have an invalid area on it window rect for a paint message to be generated. When you were looking to invalidate the rect of the window that is more along the lines of what you need to do.
If you want to force a repaint of the window use the RedrawWindow function. Here is an example.
m_SpellCastingBar.RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_NOERASE | RDW_UPDATENOW);
The first two nulls indicate that you want the entire window to be updated. The flags say that you are invalidating the update region of your window because you can validate the window as well and prevent WM_PAINT messages from being called. RDW_NOERASE says do not generate a WM_ERASEBKGND message, and the RDW_UPDATENOW flag says expedite this request, and send the WM_PAINT message before the function call ends.
Coincidentally, these two function calls will do the equivalent of the RedrawWindow function above.
m_SpellCastingBar.InvalidateRect(NULL);
m_SpellCastingBar.UpdateWindow();
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
In a C++ class for a COM class, I have a method declared (which is a [out, retval] parameter):
<br />
STDMETHODIMP CSimCom::toString(BSTR *strdate)<br />
{<br />
...<br />
*strdate = cstr;
}<br />
|
|
|
|
|
*strdate = cstr.AllocSysString();
BTW, try not to use MFC in ATL projects.
You can use _bstr_t ATL wrapper class for strings, or CComBSTR.
Goodluck,
Dudi
|
|
|
|
|
Thanks ^^
but i should use MFC too, as it is using some classes in a DLL dependent in MFC. I got that from MSDN too.
|
|
|
|
|
Hello,
I am reading a file in my program that resides in the same directory as my program EXE file. When I execute the file by double clicking the file .. it works fine .. but when I execute it through the start menu icon that was created using installshield, using the follwing installshield code,
svPath = TARGETDIR ^ "TDMS2000.exe";
LongPathToQuote ( svPath , TRUE );
AddFolderIcon (FOLDER_PROGRAMS^SHELL_OBJECT_FOLDER , "TDMS2000" , svPath , "" , "" , 0 , "" , REPLACE );
It says that it could not find the text file. Please tell me what I need for it to see the file.
Thanks!
sincerely,
Anjum.
|
|
|
|
|
Can someone give me some clues on how I can do the following things, eg what sort of messages I need to be overriding.
- I have an MDI app. When the MDI frame is loaded, I load a modeless dialog box acting as a toolbox. Id like to be able to drag things from this toolbox onto the view.
- Once things are dragged onto the (CView derived) view, id like to be able to drag them around, and possibly be able to link them up, eg when i ricght click on one of the nodes a line is extended, and when this is released on top of another node, things happen in the document.
Ive never been able to get much use out of Spyy++.
|
|
|
|
|
I am trying to retrive a some data from a database,
filling a dataset,
modyfieng the data,
updating the database.
I have the gotdotnet guide on how to make this, in Managed C++:
{
// Database connection string
SqlConnection* myConnection = new SqlConnection (S" User ID=;Password=;Initial Catalog=catalog;Data Source=(local)");
// Open connection
myConnection->Open();
// SQL Query
// Create the SQL statements inserting the Username and the Password received as parameters.
String* szQuery = String::Concat("SELECT * FROM Users WHERE UserID = '", szUsername);
szQuery = String::Concat(szQuery, "' AND Password = '");
szQuery = String::Concat(szQuery, szPassword);
szQuery = String::Concat(szQuery, "'");
SqlDataAdapter* mySqlDataAdapter = new SqlDataAdapter(szQuery, myConnection);
DataSet* myDataSet = new DataSet();
mySqlDataAdapter->MissingSchemaAction = MissingSchemaAction::AddWithKey;
mySqlDataAdapter->Fill(myDataSet, "Locals");
DataRow* myDataRow = myDataSet->Tables->Item["Locals"]->Rows->Item[0]["ContactName"]="Peach"; //this line gives error C2107
SqlCommandBuilder* mySqlCommandBuilder = new SqlCommandBuilder(mySqlDataAdapter);
mySqlDataAdapter->Update(myDataSet,"Locals");
}
but the line where i try to modify the data in the DataRow gives the error: error C2107: illegal index, indirection not allowed
How I fix it please?
P.S.
I cannot access it through the Find method, because I am not able to know the value of the primary key to research.
"Nelle cose del mondo non e' il sapere ma il volere che puo'."
|
|
|
|
|
Is there any differece between OnDraw or OnPaint functions?
Where should custom drawing should be implemented?
|
|
|
|
|
Rules
CView based classes use OnDraw,
General CWnd based classes use OnPaint
Custom OwnerDraw should use OnDrawItem
Normski. - the next bit of code is self modifying ... jmp 0xCODE
|
|
|
|
|
|
Customdraw an ownerdraw is 2 different things.
Customdraw is handled in response to WM_CUSTOMDRAW
/M
- Don't sweat the petty things, and don't pet the sweaty things.
|
|
|
|
|
Hi,
I am looking at rewritting a routine, where each line reference an object.
pObj->method1
pObj->method2
pObj->method3
pObj->method4
Is there any way of eliminating the need to specify the object, bit like that Pascal and VB with statement.
Cheers
Rich
|
|
|
|
|
You can return 'this' pointer from each method and then you will get:
pObj->method1()
->method2()
->method3()
->method4();
|
|
|
|
|
How to handle notepad or wordpad (along with their menus as to disable or enable them) through coding with visual c++ 6.0. Please submit me sample coding(source & exe) on this topic in detail. I need very very much.Thanking you...
amit prakash srivastava
|
|
|
|
|
Amit Prakash Srivastava wrote:
Please submit me sample coding(source & exe) on this topic in detail
Do I get punished if I don't provide enough detail ?
There is either an article on CP or in an old MSDN or MSJ mag on this topic. It hooked into notepad and added an extra item to the menu, a word count from memory.
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
I've some toolbars in the same frame; if I try to dock all of them in the same border (i.e. TOP), i would like that they appear on the same line (as when you open Word) instead that having one line for any Toolbar.... the user can drag and move them in the same line, so I think that it should be possible....
|
|
|
|
|
|
I think that it should be possible even without a CRebar (it doesn't allow floating ControlBars)...
I tryed also using the CBRS_FLOAT_MULTI style but it seems not to work...
When it starts bars are positioned in this way:
[BAR1]
[BAR2]
[BAR3]
What I want is thatm the first time the program is run, the bars appear in this order:
[BAR1][BAR2][BAR3]
If the user move them and I save the status, the next time they will appear correct...
|
|
|
|
|
Ok, here's another one about game programming. Should I stick with Visual C++ 6.0 for game design or upgrade to Visual C++ on Visual Studio .NET? Is there something new to Visual Studio .NET that would help in game programming or everything's fine with Visual Studio 6.0 and .NET is just for, well, .NET programming? Thx!
|
|
|
|
|
I'd imagine you'll probably want to stick with Visual C++ and avoid the additional overhead of using managed code via. the .NET framework, or calling unmanaged code from managed.
If it isn't broken, why try and fix it
I see .NET primarily for rapid development of enterprise distributed systems, not really a games thing
|
|
|
|