 |

|
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|

|
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|

|
Hi,
I am having a number of problems Getting my richedit to work with my Modless Dialog Box
it started with scrolling as I was unable to get the Current Line and then I while trying to debug it
I noticed the I was I using DDX to connect my crichedit class with the resource defined window
which the documentation says only works for modal however when I comment out the UpdateData
and used the CRichEdtCtrl::Create to connect my windows class to the resource window none the Streamed in data is displayed I'll display the code along with the resource statements
The Create of the modeless Dialog
ret = progdbg->Create(IDD_PROGDBG,(CWnd *)this);
BOOL CprogDebug::OnInitDialog()
{
int FirstVisible;
long start, end, theline;
myedit = new CProgedit; CRect myrect(17,39,735,273);
myedit->SetOptions(ECOOP_OR, ECO_AUTOVSCROLL | ECO_AUTOHSCROLL);
UpdateData(FALSE); EDITSTREAM es;
CStdioFile *fileptr = new CStdioFile;
fileptr->Open(proglisting,CFile::typeBinary);
es.dwCookie = (DWORD) fileptr;
es.dwError = 0;
es.pfnCallback = (EDITSTREAMCALLBACK) readlisting;
myedit->StreamIn(SF_TEXT, es);
myedit->SetFocus();
theline = myedit->LineFromChar(myedit->LineIndex(-1));
myedit->LineScroll(-theline,0);
myedit->HideSelection(TRUE,FALSE);
ShowWindow(SW_SHOW);
CDialog::OnInitDialog();
return TRUE;
}
IDD_PROGDBG DIALOGEX 0, 0, 779, 345
STYLE DS_SETFONT | DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "Dialog"
MENU IDR_HERC_CMDTYPE
FONT 8, "Times New Roman", 400, 0, 0x0
BEGIN
CONTROL "",IDC_RICHEDIT22,"RichEdit20A",WS_CHILD | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_MULTILINE | WS_BORDER | WS_TABSTOP,17,39,735,273
END
void CprogDebug::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX,IDC_RICHEDIT22,(CWnd &)*myedit);
}
|
|
|
|

|
Hi, I implemented a wheel-zoom function. It behaves exactly as I expect on primary monitor. But when I move application to secondary monitor, the wheel zoom behavior is different. How can correct it? Thanks, transoft
|
|
|
|

|
i want to design a matchbox like this
program will take 9 numbers and convert them to hexadecimal number,and draw matchbox and then find a way ,from matrix begin (0,0) to matrix last element (3,3).
http://r1305.hizliresim.com/19/s/ndzby.png[^]
|
|
|
|

|
Hi all. I have an dialogbar, which can be floated ... somewhere, in the statusbar, I have an indicator, a CButton, that tell me if the dialog bar is showed or not ... which does function well ... but when the dialogbar is in the floating state, and the user close the dialogbar from "Close" menu button, I don't know how to signal the statusbar button ... there is an handler to treat when user close the dialogbar from "Close" menu button ?
|
|
|
|

|
hello:
i want from any one who have Visual studio 2010,or 2008 may work,
to Click the Tools menu>>Options>>Projects and Solutions>>VC++ Directories>>
well here is my problem i should find :Select include files for "Show directories for"
but i have like that :
VC++ Directories editing in TOOLS >Option has been deprecated
VC++ Directories are now available as a user property sheet that is added by default to all projects, Please click '?' for more information.
please help
|
|
|
|

|
Can anyone tell me how to drive is not used to enter Ring0?
|
|
|
|

|
Hi, I want to change the background bitmap of a dialog dynamically, for example, press button1, the background turn to image1, press button2, the background turn to image2.
I try to use a bool variable,like:
if (btnimg == 0) dlg.loadbitmap(image1);
else dlg.loadbitmap(image2);
it not work well.
|
|
|
|

|
how to set char limit so that it should not exceed the 11 char .
after exceeding 11 char does not allow to press the key.
any example will helpful
|
|
|
|

|
Hi everyone,
I need to use MagSetImageScalingCallback to capture the desktop screen. But I cannot find out how to call it correctly. I know it's odd, but do you have any idea about this deprecated function?
|
|
|
|

|
Hi When I first got my laptop last august my application that I was developing (at least the TCP/IP code) was running fine about now my laptop runs a lot slower I tried to clean it up but it still doesn't run nearly as fast it did when I bought it towards that end on My CAsyncSocket::OnConnect overridble I am getting the following nErrorCode WSAETIMEDOUT I am wondering what is the best approach to this is modifying a registry key for the TCP/IP time out value (I am running Windows 7) Maybe start clean re-install of Windows Any suggestion appreciated Thanks
|
|
|
|

|
does anyone have the source code of sudoku?, but that requires us to input numbers and and using C
|
|
|
|

|
Can anyone explain me why the following C++ snippet does compile and not end up in a compiler error ?
int main()
{
double d;
d = 0,2;
return 0;
}
I would expect the double assignment should be
double d;
d = 0.2;
Because I couldn't believe it, I tried VisualStudio 2010, -2005 AND -6, all three compiled with 0 errors, 0 warnings...
|
|
|
|

|
Hi,
I have one function which is return string array in my C++ dll .from this function how can return error .please help me .
Thanks
|
|
|
|

|
In a dialog, WM_PAINT message handler, I set a timer.
void CXYZDlg::OnPaint()
{... SetTimer(12, 2500, NULL);}
in the OnTimer(),I found I have to set it again, then it goes into
the breakpoint in OnTimer() repeatedly. otherwise, it only goes into the OnTimer() function once.
<pre lang="c++">void CXYZ::OnTimer(UINT_PTR nIDEvent)
{
if (g_Scroll == 1) {
if ( sc< 16 ){
BuzzerOnce(1);
SC++;
}
else
sc = 1;
}
...
SetTimer(1361, 2500, NULL); CDialog::OnTimer(nIDEvent);
}
|
|
|
|

|
I am building an application that needs to compress data before being sent via socket. Performance is very very critical and I want to make use of native functions i.e. no interop calls into .net libraries. I am building it as a C++ application.
I did find Compression API that will take an input and provide a compressed output. PLEASE BEAR THE FACT THAT I AM NOT USING ANY FILES (DISK FILES). Instead I am just dealing with raw stream.
But this Compression API is available only from Windows 8 onwards and Windows Server 2012. How do I go about finding a solution if I were to do this on Windows 7 and and a server that is say 2008 or 2003
Hickups:
Cabinet API does not help as it always does it thru files?
Explored the option of CMemFile and see if I can break the ice but the m_handle is of no use nor will there be a need to open or close files as I am just dealing with raw bytes.
|
|
|
|

|
Hi,
I am trying template for splitter view but getting error in IMPLEMENT_DYNCREATE_T.
I am using VS2008. Plz help
|
|
|
|

|
New motherboards do not have built in printer ports. There are many devices that used these ports. I have several chip programming adapters.
I would like to be able to read and write the LPT ports directly. Not using the Windows print spooler.
Does anyone know where to get the port information for PCI parallel port?
Bob Macklin
Seattle, Wa
|
|
|
|

|
Hi guys,
i'm creating an app in c++ that uses the FileSystemEventArgs.
In my code i added the namespace System::IO;
My problem is, the System Namespace will work if in my configuration
Common Language Runtime Support = /clr
but it produces an error if
Common Language Runtime Support = No CLR Support
Need you ideas guys what to do. I need my app to be configured with No CLR Support.
Thanks
|
|
|
|

|
hello,
Is there way to disable Cut,Copy,Paste,Rename and Delete operation for a particular file with (.extension)
in windows ...
please Reply me ....
|
|
|
|

|
Is it possible to develop a multi platform applications in vc++. If yes then what i have to do for that.
|
|
|
|

|
I was asked to build a MFC appliation, which will execute a window Command line when you type a window Command line & press "Eter".
But i don't know how to handle Enter key event in multiline Edit control.
Please help me! Thanks so much!
|
|
|
|

|
can you give me a project of VS 2010 C++ to hook WM_CLOSE message on all process?
Thank you!
~Peter
|
|
|
|

|
Hello Everybody,
I have created one SDI Application with one dialog - having some controls. In that, if I click a button, I want to show a child window and with the following code, I am getting that fine.
CMainFrame *pMainFrm = ((CMainFrame*)(AfxGetApp()->m_pMainWnd));
CFrameWnd *pFrame = new CFrameWnd;
RECT rect;
pFrame->Create(NULL,_T("Solution"), WS_OVERLAPPEDWINDOW ,rect,this);
pFrame->ModifyStyle(WS_CAPTION + WS_OVERLAPPEDWINDOW , WS_BORDER,SWP_NOMOVE +SWP_NOZORDER );
pFrame->InitialUpdateFrame(pMainFrm->GetActiveDocument(),TRUE);
pFrame->SetWindowPos(&CWnd::wndTopMost,100,200,1000,400,SWP_SHOWWINDOW);
pFrame->ActivateFrame(SW_SHOWNORMAL);
Now, I would like to write some text on that child window. Any suggestions? I tried in google also.
Thanks in advance,
A. Gopinath.
|
|
|
|

|
I have VisualC++ Ver 5. I have been using it for close to 20 years. I know it's old but so am I.
My problem is that my version of VC++ crashes frequently when used on a WinXP computer.
But on a Win2K computer it runs for hours before crashing.
Is there something I should know about running VC++ on a WinXP computer?
Bob Macklin
Seattle, Wa.
|
|
|
|

|
Hi,
I am working on a project in which I am using DirectShow for Capturing and Displaying Videos.
It works fine for Windows XP and Windows 7, but when I try to play the same video on Windows 8, its output gets corrupted. It doesn't display the actual videos colors, instead the color turns into Grey for the whole video. I tried to update DirectShow for Windows 8, checked in the code also, but all in vein....Still the same issue.
I am trying to play a file of .wmv format. Issue persists for other formats also.
Do I need any missing codec in Windows 8 or any other solution for this problem.?
How it could be possible that a video displays fine for Windows XP, and 7 but not for Windows 8.
Anybody have any idea regarding this.?
Any help will be appreciated.
Regards,
Mbatra
modified 3 days ago.
|
|
|
|

|
I am building my first real DLL. I am using DirectShow “Base Classes” library to build a custom DirectShow filter based on sample code from DirectShow SDK.However, this is not DirectShow question. I managed to build VC 6.0 DLL, however, the problem is that it builds “External Dependencies” - in this case basetsd.h taken from the original VC6.0 installation which is now hopelessly inadequate for this application. My basic question to the gurus here – what exactly is “External Dependencies” as used in MFC DLL (VC6.0) wizard? Is is similar to “additional include / library links? So far I cannot see it in command line. Any help would be greatly appreciated and if such thing exists in later MS IDE please let me know and I'll look for it there. But from my recent experience I am reluctant to download any VS after 6.0! Cheers Vaclav Addendum: Here is MSDN 2001 definition: Note The External Dependencies folder lists files that are not part of the project but that are needed to build the project. You can add a file to the project by simply dragging it from the External Dependencies folder to any of the project folders, or to any top-level project node. So, it means that "standard" "include" path is used to load the OLD "basetsd.h". I guess I'll modify the original basetsd.h to make things fly.
-- modified 19 May '13 - 13:49.
|
|
|
|

|
getting linking error for a class which implements IMPLEMENT_RUNTIMECLASS_T macro.
|
|
|
|

|
- I've created a CPngButton from CBitmapButton.
- It overrides DrawItem() and draws the given PNG image using GDI+.
- The wm_erasebkgnd and wm_ctlcolor is taken care.
- while displaing the CMainFrame its displaying properly.
- Later if we resize the window couple of times, the transparent portions of button becomes black.
- OS is Windows 7 with Aero enabled.
- Screenshot is here[^]
- Any idea what I'm missing here?
(Some more information: The buttons are hosted on a CWnd as container. This CWnd is placed over left of menubar to looks like a quick access toolbar, which is a requirement).
Best Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|

|
hi all,
I am using
static char alphabet[] =
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"0123456789";
static int alphabet_size = sizeof(alphabet) - 1;
CString str_val=_T("");
void brute_impl(char * str, int index, int max_depth)
{
int i;
for (i = 0; i < alphabet_size; ++i)
{
str[index] = alphabet[i];
if (index == max_depth - 1)
{
str_val.Format("%s", str);
}
else
{
brute_impl(str, index + 1, max_depth);
}
}
}
void brute_sequential(int max_len)
{
char * buf = new char[max_len + 1];
int i=0;
while(buf[i] != NULL)
{
if(i==max_len+1)
break;
buf[i]='\0';
i++;
}
CString str=_T("");
str.Format("size of array is %d\n", i);
for (i = 1; i <= max_len; ++i)
{
memset(buf, 0, max_len + 1);
brute_impl(buf, 0, i);
}
free(buf);
}
but its time consuming and very slow
anybody have more efficient and fast method for this.
thanks.
|
|
|
|

|
hi guys recently i started to work with open gl in dev c++ 4.9.9.2. I downloaded the glut package and all the dlls and object files. After installing it i tried a sample program. But i got lot of linker errors and it didnt run eventhough my syntax was correct. Anybody please help
|
|
|
|

|
Hello,
I've just started to programm in C++, using Builder C++. I need to stablish comunication via internet between two computers. I've succed using the ClientSocket Component and the ClientServer but only if the computers are in a local network but not if the computers are in different networks. Here is my code for the server:
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
//--------------------Abrir el Servidor---------------------------------------//
void __fastcall TForm1::BAbrirClick(TObject *Sender)
{
//Configurar el número de puerto
ServerSocket1->Port=StrToInt(Npuerto->Text);
//Abrir el servidor
ServerSocket1->Open();
//Actualizar estado de los botones
BAbrir->Enabled=false;
BCerrar->Enabled=true;
//Informar de que se ha abierto el servidor
BEstado->SimpleText="Servidor Conectado!";
//Indicar el número de conexionoes activas
NOnline->Text=IntToStr(ServerSocket1->Socket->ActiveConnections);
//Activar el Boton de enviar mensaje
BEnviar->Enabled = true;
}
//----------------------------------------------------------------------------//
//---------------------Cerrar el Servidor-------------------------------------//
void __fastcall TForm1::BCerrarClick(TObject *Sender)
{
//Cerrar el Servicio
ServerSocket1->Close();
//Actualizar estado de los botones
BAbrir->Enabled=true;
BCerrar->Enabled=false;
//Informar del cierre del servidor
BEstado->SimpleText="Servidor Cerrado!";
//Actualizar el campo de nº de conectados
NOnline->Text=IntToStr(ServerSocket1->Socket->ActiveConnections);
//Desactivar el Boton de enviar mensaje
BEnviar->Enabled = false;
}
//----------------------------------------------------------------------------//
//---------------------Cuando se Conecte un Cliente---------------------------//
void __fastcall TForm1::ServerSocket1ClientConnect(TObject *Sender,
TCustomWinSocket *Socket)
{
//Mostrar aviso en la barra de estado
BEstado->SimpleText="Conectado desde "+Socket->RemoteAddress;
//Actualizar el número de conectados
NOnline->Text=IntToStr(ServerSocket1->Socket->ActiveConnections);
}
//----------------------------------------------------------------------------//
//---------------------Al Desconectarse un Cliente----------------------------//
void __fastcall TForm1::ServerSocket1ClientDisconnect(TObject *Sender,
TCustomWinSocket *Socket)
{
//Actualizar el número de conectados
NOnline->Text=IntToStr(ServerSocket1->Socket->ActiveConnections-1);
//Informar de la desconexión
BEstado->SimpleText="Desconectado de "+Socket->RemoteAddress;
}
//----------------------------------------------------------------------------//
//---------------------Al recibir un Mensaje----------------------------------//
void __fastcall TForm1::ServerSocket1ClientRead(TObject *Sender,
TCustomWinSocket *Socket)
{
//Espacio para recibir el mensaje
char * buffer;
int len;
AnsiString Mensaje;
int i;
// Recibir mensaje
int *tam;
tam = new int;
*tam = Socket->ReceiveLength();
len=Socket->ReceiveBuf(buffer,*tam);
buffer[len]=0;
//Estructura para mostrar el mensaje correctamente
TTime hora = TTime::CurrentTime();
AnsiString MensajeIn = Socket->RemoteAddress;
MensajeIn += " A las " + TimeToStr(hora) + " Dice" "----->";
ChatBox->Lines->Add(MensajeIn +StrPas(buffer));
BEstado->SimpleText=IntToStr(len)+"Nuevo mensaje entrante!";
// Repetir el mensaje a los demás
Mensaje = StrPas(buffer);
strcpy(buffer,Mensaje.c_str());
for(i=0;i<ServerSocket1->Socket->ActiveConnections;i++)
ServerSocket1->Socket->Connections[i]->SendBuf(buffer,strlen(buffer));
delete[] buffer;
}
//----------------------------------------------------------------------------//
//--------------------Enviar un Mensaje---------------------------------------//
void __fastcall TForm1::BEnviarClick(TObject *Sender)
{
//Espacio para meter el mensaje
char buffer[256];
int i;
//Recoger el Mensaje del campo de entrada
AnsiString Mensaje = CampoMensaje->Text;
strcpy(buffer,Mensaje.c_str());
//Enviarlo a los conectados
for(i=0;i<ServerSocket1->Socket->ActiveConnections;i++)
ServerSocket1->Socket->Connections[i]->SendBuf(buffer,strlen(buffer));
//Añadirlo al Chatbox
TTime hora = TTime::CurrentTime();
ChatBox->Lines->Add("Servidor a las " +TimeToStr(hora)
+ " dice----->" + Mensaje);
}
//----------------------------------------------------------------------------//
//---------------------Borrar la Memo-----------------------------------------//
void __fastcall TForm1::LimpiarClick(TObject *Sender)
{
//Borrar
ChatBox->Clear();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::CampoMensajeKeyUp(TObject *Sender, WORD &Key,
TShiftState Shift)
{
if (Key == 13)
TForm1::BEnviarClick(CampoMensaje);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::NpuertoKeyUp(TObject *Sender, WORD &Key,
TShiftState Shift)
{
if (Key == 13)
TForm1::BAbrirClick(Npuerto);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::TcpServer1Accept(TObject *Sender,
TCustomIpClient *ClientSocket)
{
//Configurar el número de puerto
TcpServer1->RemotePort = StrToInt(Npuerto->Text);
//Abrir el servidor
TcpServer1->Open();
//Actualizar estado de los botones
BAbrir->Enabled=false;
BCerrar->Enabled=true;
//Informar de que se ha abierto el servidor
BEstado->SimpleText="Servidor Conectado!";
//Indicar el número de conexionoes activas
NOnline->Text=IntToStr(ServerSocket1->Socket->ActiveConnections);
//Activar el Boton de enviar mensaje
BEnviar->Enabled = true;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::TcpServer1CreateHandle(TObject *Sender)
{
//Actualizar el número de conectados
NOnline->Text=IntToStr(TcpServer1->Active-1);
//Informar de la desconexión
BEstado->SimpleText="Desconectado de "+TcpServer1->LocalHostName();
}
//---------------------------------------------------------------------------
How can I implement comunication (a simple chat is enough) between the two computers?
|
|
|
|

|
Hey all, I'm not sure if this is the right place for this kind of discussion but I’ll ask anyways. I’ve been working on embedded systems for a while, mainly in C. I’d like to do more with C++/.Net (or other OOP languages/frameworks etc..) but I don’t know where to start in terms of a non-embedded project. My question is; does anyone have an idea for a project or perhaps worked on something that was useful and more challenging than text book style projects (ie something more “real world” that I can use to gain OOP experience in my own time). Any thoughts would be appreciated.
|
|
|
|

|
static int pstate_param_set(char *val, int kp)
{
return 0;
}
static int pstate_param_get(char *buffer, int kp)
{
return 0;
}
struct mystruct
{
int (*set)(char *val, int kp);
int (*get)(char *buffer, int kp);
};
static struct mystruct jober = {
.set = pstate_param_set,
.get = pstate_param_get
};
==============================
Nothing to say.
|
|
|
|

|
ok i have a problem with MFC, i have two dialogs and an additional class, in first dialog i create an object of my custom class and set its values, now i want to pass my object to an other dialog to manipulate it, how can i do that?
|
|
|
|

|
I need to integrate a facebook login in my application so I want to know if there are library to add!!!!! Thanks in advance.
|
|
|
|

|
I just read an article which augues that coding with only one programming language would limit one's capability to code.
I'm a little confused about this argument, because I've always thought that, one developer proficiently mastering one language outperforms one using many language but he actually knows relatively little about each one.
So, I'm not sure whether the idea of the passage I read is very correct.
I just want to hear more opinions about this issue, so, please feel free to show your thoughts about it.
|
|
|
|

|
I have Microsoft Visual C++ 2008 and Windows 8. Please how can I make an existing project compile into static mode (not dynamic mode), so that variables and malloc()'ed storage stay in the same place through a run of a program?
A program which compiled and ran correctly under Windows Vista now acts odd as if declared variables and/or malloc()'ed storage sometimes move about.
|
|
|
|

|
hello,
I tried googling for an algorithm to compress/encrypt a shor fixed size string from 52 characters down to 40 but can't seem to find any.
Target strings are random alphanumeric [A-Z0-9]
e.g "M5KS07VHN2X42JCY1PFHE1ZZGI2XUBDFAKQBEPFB7CH4SECXHJXL"
I have tried huffman and smaz (https://github.com/antirez/smaz") and both inflated to size of the original string.
Does anyone know a good algorith for such purpose?
Thanks,
|
|
|
|

|
I want to check the checkboxes in a CLIstCtrl object, on a CDialog based application:
void CTestListCtrlDlg::OnClickList1(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
if(0 <= pNMListView->iItem)
m_List.SetCheck(pNMListView->iItem, TRUE);
*pResult = 0;
}
when I made a click on a list item, the checkbox of the clicked item will check, but when I try to check the checkbox from check box itself (made a click inside of checkbox), it does not check it ... why ? It will be checked only from a double-click ... what I'm doing wrong ?
|
|
|
|

|
Look the fragment of this code. I wanted to ask, why Draw text to static bitmap does not work.
m_bmpModulation.CreateBitmap(xOrder, yOrder, 1, 24, (void *)lpBits);
if (!::IsWindow(m_staModulation.m_hWnd))
m_staModulation.Create(_T("A bitmap static control (A)"), SS_CENTERIMAGE | SS_BITMAP | WS_VISIBLE, CRect(20, 20, 20 + xOrder, 20 + yOrder), this);
m_staModulation.SetBitmap((HBITMAP)m_bmpModulation);
delete [] lpBits;
CDC *pDC = m_staModulation.GetDC();
if (pDC)
{
int nIldMin, nIldMax;
swscanf(set.m_strModulationIldMin, L"%d", &nIldMin);
swscanf(set.m_strModulationIldMax, L"%d", &nIldMax);
int x, y;
x = 218 - (int)(nIldMin * (float)197 / (float)295);
y = 0;
pDC -> DrawText(L"Min", 3, CRect(y, x, y + 20, x + 13), 0);
x = 218 - (int)(nIldMax * (float)197 / (float)295);
pDC -> DrawText(L"Max", 3, CRect(y, x - 13, y + 21, x), 0);
float fFrequency;
CString str;
str = set.m_strModulationFrequency;
str.Replace(L",", L".");
swscanf(str, L"%f", &fFrequency);
str.Format(L"%.02f", (double)1 / fFrequency);
pDC -> DrawText(str, str.GetLength(), CRect(290, 224, 330, 236), 0);
}
else
AfxMessageBox(L"No Device Context.");
}
I think, problem is, that drawed text is under the bitmap. Any suggestion how to fix it?
modified 15 May '13 - 3:37.
|
|
|
|

|
Hi, everyone.
I am finding solution which can use to read Excel format into MFC. I have questions in next 2cases. Answer me please.
case 1. Without MS Office package.
Although Excel isn't installed in my computer, I must read excel file into my MFC program. How can I parse this format without execl's COM interface?
case 2. importing Excel version is different.
I installed Excel 2007 into my computer, but I must read Excel 2010 file into my MFC program. If MS Office were installed in my computer, we can use to read Excel format into MFC using Excel's open COM interface. But, when supporting version is different from my version, how can I solve this problem?
|
|
|
|

|
We are currently maintaining a Windows application (MFC). Which retrieves data
from an XML files.
The XML file contains large data to display the UI components which are
created dynamically in
the CScrollView window or class.
Under Windows XP platform the UI components can be created dynamically and
displayed in the
CScrollView properly. The UI components are so large. 504 components to be
exact. These contains buttons,
labels, edit box, spinners, comboboxes and others. The window or screen does
not get corrupted or
destroyed. The vertical scollbar works properly.
But under Windows 7 platform, the UI components are not displayed properly.
When it reach to a certain group no, the groups are overlapping other groups resulting to a bad display. The vertical scroller or scrollbar does not work properly. I already tried comparing the values that holds the sizes and ranges for scroll member variables but so far they have similar values. This program had already handled the above 32k range scroll range issue.
We are currently maintaining this project in a Visual Studio 2005 C++ project (IDE).
|
|
|
|

|
Hi My rich edit displays the text I streamed in Somewhere in the middle of the text I have tried various methods e.g. GetCurrentLine LineIndex with a value of -1 to get the current line Index to use in LineScroll to scroll back to the top Of the rich edit but each of these methods returns 0 Any help appreciated it
|
|
|
|

|
I am trying to figure out how to create a emulator that loads multiple generic hid mouse devices in c (or generic mouse devices). Generic drivers are ones that are included with windows already. Anyone know where I should start or if this would be a hard task?
The end result is to make a c driver that emulates mouse input like the sendinput api except with multiple mouse devices.
The programs I was trying to get this to work in are: programs created with Microsoft multipoint sdk and Microsoft mouse mischief.
So far I do not have a c driver but have the technical details of the device on my project page (I want to get rid of dsf since its not 64-bit compatible): http://kinectmultipoint.codeplex.com. The emulator on the project does work now but I want to try and code a better system in.
jeffery
|
|
|
|

|
Hello Every one,
I am adding some key in Registry is not getting into effect until system reboot or by killing explorer.
so how can i achieve it, without rebooting and killing explorer.
please help me out ..
Regards
sarfaraz
|
|
|
|

|
I want to ask you something: why CBitmap::CreateCompatibleBitmap() fail on large bitmap files ? I have:
VERIFY(m_Bitmap.CreateCompatibleBitmap(pDC, nWidth, nHeight));
and on large bitmaps, on debug, I get assert error ... why ?
|
|
|
|

|
Hello Everybody,
I am trying to pass some values to char ** (to a third party library). But i am getting some issue in that.
char** ids = new char*[m_Size];
for(int i=0; i<m_Size; i++)
{
ids[i] = mSizes[i].GetBuffer(mSizes[i].GetLength()); }
using that third party function, its creating an output file and in that file the stored value is showing like this.
GROUP : 46,0
GROUP : 44,0
GROUP : 42,0
GROUP : ÝÝÝÝÝÝÝ݆«ãe,0
GROUP : 40,0
GROUP : 38,0
But if I give values like this, then in output file, the values are showing fine.
char* ids[6] = {"38", "40", "42", "44", "46", "48"};
in the output file,
GROUP : 38,0
GROUP : 40,0
GROUP : 42,0
GROUP : 44,0
GROUP : 46,0
GROUP : 48,0
(see the sequence also)
what i am doing wrong? initialization ? or passing values ?
Thanks,
A. Gopinath.
|
|
|
|

|
Hi,I want to change the string of a menu item,the string contains a '\t',like
"hello\tworld",I use CMenu::ModifyMenu function,I tried many times,the string always "hello",not"hello world",It will lost the string after '\t',Why,How to change it.
Thanks
|
|
|
|
 |
|