|
thanks.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
I'm writing a small app in visual c++ 6 using MFC. The app uses an Access database to store user info and such.
In the program users can enter a bunch of data into a listbox. The problem is I don't know how much is going to be entered so I can't just create n fields in the database to hold the info.
I tired making a separate table for the ListBox entires and linking the two but searching the tables gets all messed up in my program now. I can't even use the GetTableName() function to find out what table I'm currently is.
Ideas?
|
|
|
|
|
What are you trying to do? How could you possible build a database where you don't know how many fields you would have? Are you building a "database maker"?
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
Would there be any milage in using direct CREATE TABLE SQL, formed dynamically at runtime, prefixing each new table with a unique ID?
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hello I am interested in programming a desktop dancer like on mp3dancer.com for a student project and would like to know if anybody would know what programming language i would use and how i would go about it.
Kindest Regards
Pete
|
|
|
|
|
I have seen a book once where they would teach your DirectX programming, and even though I don't know how use DirectX, I think that's what you need to use.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
It appears that you're basically looking to have a set of different pre-rendered animations with connecting frames (or one giant looping animation) and you just want to vary the speed based on the BPM of music being played by other applications.
There are a number of different subprojects involved in this:
- Displaying the animation -- This is probably the simplest part. You can either use DirectDraw (the DirectDraw interface is part of the DirectX 7 interfaces, available for C, C++, VB, and C# in the DirectX 9 SDK), GDI, SDL, Direct3D, or OpenGL. GDI or SDL are probably the easiest way to go here (imho).
- Monitoring music being played -- Maybe try checking out the IDirectSoundCapture8 interface to get started.
- Analyzing the BPM of the music -- Here you'll need to analyze the waveform and derive a beat. I haven't done signal analysis at all, so maybe somebody else can shed some enlightenment.
- Mike
|
|
|
|
|
Hi!
I want to retain only *one* text-format in a CRichEdit derived class of mine. Now if the user paste text into my edit this plan goes not so well.
Then I try something like this:
<br />
BOOL CCalEdit::PreTranslateMessage(MSG *pMSG)<br />
{<br />
BOOL bResult = CRichEditCtrl::PreTranslateMessage(pMSG);<br />
if(pMSG)<br />
{<br />
if((pMSG->message & WM_COPY) == 1 && IsKeyPressed(VK_CONTROL)):-O<br />
{<br />
if(::OpenClipboard(NULL))<br />
{<br />
HANDLE hCB = ::GetClipboardData(CF_TEXT);<br />
if(hCB)<br />
{<br />
LPVOID pCB_Void = (LPVOID)hCB;<br />
LPSTR pCB_String = (LPSTR)pCB_Void;<br />
CString cstrCB(pCB_String);<br />
if(!cstrCB.IsEmpty())<br />
{<br />
HideSelection(TRUE, FALSE);<br />
SetSel(0, -1);<br />
CString cstrThis(GetSelText());<br />
ReplaceSel(cstrThis);<br />
HideSelection(FALSE, FALSE);<br />
}<br />
}<br />
::CloseClipboard();<br />
}<br />
}<br />
}<br />
return bResult;<br />
}<br />
Seems like I got several problems.
a. My -if(...) is not a 100% secure way to determine if a paste op. is in progress - ??? How do I do that?
b. Second - how do I apply my format to the text on the clipboard?
I've have a SetDefaultCharFormat() in my class that I call when I create the edit and it's the job it does that I want to apply also on the text on the clipboars *before* it is pasted in.
I appreciate any idéa.
Ps. There seems to be a LOT of WM_PASTE going ind - after some testing I ended up with: (pMSG->message & WM_COPY) == 1 - don't say it's perfect yet.
Regards,
Michael Mogensen, mm it-consult dk.
><((((º> ·.¸¸.· ><((((º> ·.¸¸.· ><((((º>
|
|
|
|
|
A simpler solution would be to handle the EN_UPDATE notification message, and set all the text in the control to the format that you want. You could try to make it more sophisticated by only changing the text that is new, but since the operations are fairly infrequent (in computer time...), I wouldn't worry.
FYI, EN_UPDATE notification messages are sent after the text changes, but BEFORE the display is updated - a perfect time for changing formatting.
Hope this helps
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Thanx' sharing the ideas!
And actually it helped this time. What I did was that I made the CHARFORMAT-change to the full selection in response to *not* an UPDATE event but a CHANGE ev. As it turned out an update-ev. came over and over again if I did the work on EN_UPDATE - ON_CHANGE was less sensitive. So this is how the final solution looks:
<br />
const void CCalFrameWnd::CCalendar::Note_EditChange()<br />
{<br />
TRACE(_T("Note_EditChange()\n"));<br />
long lChar_Start = 0, <br />
lChar_End = 0;<br />
CHARFORMAT cf_def;<br />
cf_def.cbSize = sizeof(CHARFORMAT);<br />
m_pEdit_Note->GetDefaultCharFormat(cf_def);<br />
m_pEdit_Note->GetSel(lChar_Start, lChar_End);<br />
m_pEdit_Note->HideSelection(TRUE, FALSE);<br />
m_pEdit_Note->SetSel(0, -1);<br />
m_pEdit_Note->SetSelectionCharFormat(cf_def);<br />
m_pEdit_Note->SetSel(lChar_End, lChar_End);<br />
m_pEdit_Note->HideSelection(FALSE, FALSE);<br />
}<br />
So I just force the def-CHARFORMAT on to the entire selection having always set the def-format first. Also I remember to be able to restore to the orig. caret pos.
It works!
Regards,
Michael Mogensen, mm it-consult dk.
><((((º> ·.¸¸.· ><((((º> ·.¸¸.· ><((((º>
|
|
|
|
|
Michael Mogensen wrote:
As it turned out an update-ev. came over and over again if I did the work on EN_UPDATE
Oops. I forgot to mention that by setting the text formatting, you cause another EN_UPDATE message to be sent, which becomes an endless recursion. You would need to set a static/class-member variable inside the handler and check it when the handler is entered to see if you're already processing the message, and return immediately if you are.
Glad to be of help
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
I need a cross-platform C++ GUI library for a new project I'm working on. Am not particularly thrilled with the current cross-platform library options I've run across. Would like to find a GUI library that works similar to and as easily as a browser, where you can input text and various controls to display on the screen using a hypertext language like HTML or embed instructions for screen layout in the code. Are there any cross-platform C++ GUI library projects in the works that sound similar to this and/or might need another developer
to help out? Are there any new cross-platform C++ GUI projects starting up that might need developers? It would be nice to get involved with a group to work on this rather than my trying to code a new GUI library all by myself. Suggestions appreciated.
Thanks.
Laura
http://www.distasis.com/cpp/
|
|
|
|
|
Have you looked at what the Mozilla team are doing with their XUL stuff.
http://www.mozilla.org/xpfe/[^]
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
I checked out the page you mentioned and wrote to the contact e-mail address there. Was told the information on the page is very old and hasn't been kept up-to-date.
Anyone have any other ideas?
Thanks.
Laura
http://www.distasis.com/cpp/
|
|
|
|
|
This is the most up-to-date link I have,
http://www.xulplanet.com/tutorials/xultu/intro.html[^]
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
i try to create a mfc dialog based xxx application.
i add the one line of code in xxxDlg.h
-------------------------------------
#endif // _MSC_VER > 1000
// newly added code
typedef CList<int,int> CPersonList;
/////////////////////////////////////////////////////////////////////////////
// CXxxxxDlg dialog
class CXxxxxDlg : public CDialog
{
-------------------------------------
however, i get the following compilation error:
d:\documents and settings\lim ming wee's
pc\desktop\xxxxx\xxxxxdlg.h(11) : error C2143: syntax error : missing
';' before '<'
d:\documents and settings\lim ming wee's
pc\desktop\xxxxx\xxxxxdlg.h(11) : error C2143: syntax error : missing
';' before '<'
can anyone tell me how can i solve this problem?
thank you.
regards
yccheok
|
|
|
|
|
#include "afxtempl.h" before. (-:
Regards,
BB
|
|
|
|
|
Hello,
how can I determine if the current build is a Unicode build? Is there any flag defined that tells me that?
For example I have this function:
{
unsigned long uStringLength = string.GetLength();
LPTSTR lp = string.GetBuffer(uStringLength);
DoBinaryWork(lp, uStringLength);
string.ReleaseBuffer();
} But if building a Unicode build this code will not work because Unicode takes 16 bits per character, therefor only the half of the string is passed to the DoBinaryWork function.
How can I check if building Unicode? I assume there is a flag that can be checked with #ifdef, but what is it?
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
the UNICODE macro is defined if UNICODE is enabled. Alternatively you could overload DoBinaryWork to take a wstring (basic_string<wchar_t>) or a string (basic_string<char>) which may be possible
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
I'm a little confused by this.
CString::GetLength() returns the length in characters - so it still returns the correct string length, and if the DoBinaryWork() function takes a LPTSTR, then it also should work correctly.
This code should work unchanged under both ANSI and UNICODE builds.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
CString::GetLength() returns the length of the string in characters (as you said), but I need it as bytes. A CString character can be 8 or 16 bits long, therefor number of bytes != number of characters.
The DoBinaryWork function takes an unsigned char * as parameter. I forgot to place a cast to the unsigned char * in the code example, sorry.
Any idea how to check for Unicode?
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
|
Thanks!
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Hi ... can any1 tell me what is wrong with the following code? i'm sure its some silly mistake that i made ... I am trying to create a Richedit control in a window. I have included richedit.h and my code compiles successfully. but _hWnd remains NULL after this call ... i am using Microsoft VC++ 6 with the Platform SDK 2003 installed. please help me out. thankx in advance.
_hWnd = CreateWindowEx(WS_EX_CLIENTEDGE,
RICHEDIT_CLASS,
TEXT("AA"),
WS_CHILD | WS_VISIBLE | ES_MULTILINE,
10, 10,
100, 100,
_parent,
0,
(HINSTANCE)::GetModuleHandle(0),
0);
-Tareq
|
|
|
|
|