|
This type of application is very typical of what people have been using Java to do. IBM's whole Linux push is based on Java applications.
|
|
|
|
|
hi,
i have created an array
UCHAR * data;
data = new UNCHAR [size]
i saved data in it ,, that PCM data (pulse code modulation)
now i want to send this (array) throught socket.
how can i
CSocket->send ( ...... , .. , ...);
Plz reply me
thanx
|
|
|
|
|
I dont know the exact syntax for CSocket but I use something like the following for sending a struct through a SOCKET..
// where sSend is a struct containing CHAR's and INT's
send(sock,(char FAR*)&sSend, sizeof(sSend), 0);
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
hello ,
i want to load icon & text string in a combo box, like the following...
-------------------------------
icon1 "text string"
icon2 "text string"
icon3 "text string"
;;;;;;;;
;;;;;;;
like that
------------------------------------
how to do that in run time in a dialog based application and form based application projects ....where these r frequent ?
waiting for reply.....
skpanda
|
|
|
|
|
Can you use CComboBoxEx ?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
When creating a standatd multidoc MFC application with class wizard there is a menu that enables the user to hide the toolbar or statusbar i wish to implement something similar in my application however, with multiple toolbars.
i went through the class wizard's code sample and i could not find the implementation of the menu - the MSDN sais that in order to implement the menu one shold override their imlementation but the don't say how.
please help me.
|
|
|
|
|
Hello!
I want to write an object to CArchive. My object is:
typedef struct tMyStructTag
{
long index;
BSTR data;
BSTR description;
} tMyStruct;
To write data to archive I do this:
1. Open the (CFile) file in r/w mode
2. Create an archive using the open file
3. Write the data
tMyStruct myStruct;
pFile->Open(...
pArchive = new CArchive(pFile, CArchive::store);
(*pArchive) << (CString)(myStruct.index);
(*pArchive) << (CString)(myStruct.data);
(*pArchive) << (CString)(myStruct.description);
Is it correct so far?
When I come to read data back, I do the same but call SeekToBegin() function for CFile class, then I read data like this:
tMyStruct myStruct;
CString strData, strDescription;
(*pArchive) >> myStruct.index;
(*pArchive) >> strData;
(*pArchive) >> strDescription;
myStruct.bstrData = strData.AllocSysString();
myStruct.bstrDescription = strDescription.AllocSysString();
::SysFreeString(myStruct.bstrData);
::SysFreeString(myStruct.bstrDescription);
When I do this for more than one object, I get data in wrong fields. I look at resulting file and it looks OK. I just cannot read data back correctly. Any help please?
|
|
|
|
|
Please help ..
I am receiving the following Fatal Linker error on Borland Builder 5 .. "Additional Segments Need To Be Defined in a .def File"
This error has only started to appear since adding some new files to an existing project, prior to that everything was fine.
I have searched the web to no avail regarding this problem ... any help that can be offered would be gratefully received ..
|
|
|
|
|
alien001 wrote:
I am receiving the following Fatal Linker error on Borland Builder 5...I have searched the web to no avail
Have you tried a Borland Builder 5 newsgroup or forum?
What is the linker error number? Have you consulted the docs for that number?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
There is no linker error number .. the full statement reads ..
[Linker Fatal Error] Fatal: 'E:\views\view1\Myfolder\base\customer\a\base.C': Additional segments need to be defined in a .def file
|
|
|
|
|
Ok, so have you added additional segments to the .def file?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I have not added any new segments to the .def file .. In fact until the emergence of this problem I was unaware of the existence of the def file and segments .. any explanation would be helpful ..
I simply added some new c files to an existing project .. the project was fine prior to that. The files added have no compilation issues and are used on other projects without any problems ..
|
|
|
|
|
There is a good discussion here.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Hi everyone,
Hi everyone
im very new to visual c++ programming, although i worked on borland c++ before.
i have a problem in controlling some controls according to a certain conditions.
for example;
I have two dialogs:
The first one is to ask the user
How many edit boxes he want to see?
The second dialog should show him the number of edit boxes he entered in the first editbox;
So if the user has entered (2) in the editbox in the first dialog,
he must see two editboxes in the second dialog.
It is very important for me to know this
Please just remember that im very new to MFC programming, so write me a clear code as a beginner.
thank you for reading my messege
F.X
|
|
|
|
|
void CYourDialog::OnButtonEnterDlgNum(void)
{
char lpBuffer[256];
m_YourEditCtrl.GetWindowText(lpBuffer, 255);
// you could also use this
// GetDlgItem(IDC_YOUREDITCTRL)->GetWindowText(lpBuffer, 255);
int iMax = atoi(lpBuffer);
CEdit *ceEdit;
for(int i = 0; i < m_yourint = iMax; i++)
{
ceEdit = new CEdit;
ceEdit.Create(0/* your styles */, CRect(0, 0, 0, 0) /* your rect */, m_YourSecondDlg /* the CWnd object of your 2 dialog */, IDC_ID + i /* your ID (must be unique!)*/);
}
}
hope this helps
Я люблю русский язикь!
|
|
|
|
|
Which recordset to use CRecordset or CDaoRecordset with Ms Access database?
I had seens many posts,threads and source code on various forums that uses CDaoRecordset with MSAccess data baseand some uses CRecordset
WHat are pros and cons of using each of them?
WHich one is better?
Thanking you?
|
|
|
|
|
The main difference is that CDaoRecordset accesses data through a Data Access Object (DAO) based on OLE. CRecordset accesses the DBMS through Open Database Connectivity (ODBC) and an ODBC driver for that DBMS. The DAO classes generally offer superior capabilities because they are specific to the Microsoft Jet database engine. So you need to decide if you want to access the data through DAO or ODBC, although the DAO classes can access both types of data sources. That will govern which class to use.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Such problem. I'm write application(not MFC) with support System Tray Icon. I try to do like this: if I select menu item then he must to set MF_GRAYED, and the other item which was MF_GRAYED must set to MF_ENABLED. For this I'm using SetMenuItemInfo. But this dont work. Though SetMenuDefaultItem is work without problem. Help me, what's the problem? Thanks in advance.
|
|
|
|
|
Does anyone know how to change paper size while printing under MFC?
The idea is that page sizes are supposed ti differ from page to page (custom sizes)
|
|
|
|
|
Had slight computer problems.
|
|
|
|
|
Do you want to change the paper size during a print job or do you want to have different paper sizes for each print job?
If you want to set the paper size for a print job you have to get the printer DC and then you can change the dmPaperSize member of the DEVMODE structure.
But I think you should give some more information what you exactly want to do.
|
|
|
|
|
Different paper sizes in one print job, every page different, not standard but custom (arbitrary) paper sizes.
|
|
|
|
|
Does anyone know how to change paper size while printing under MFC?
The idea is that page sizes are supposed ti differ from page to page (custom sizes)
|
|
|
|
|
You'll need probably different print DC to each page.
CPrintDialog dlg;
HGLOBAL hDevMode = dlg.m_pd.m_hDevMode;
DEVMODE* dm;
CDC dc;
::GlobalAlloc(hDevMode, sizeof(DEVMODE));
for (i = 1; i <= nNumOfPages; i++)
{
if (dm = (DEVMODE*)::GlobalLock(hDevMode))
{
dm->dmPaperLength = 123;
dm->dmPaperHeight = 456;
::GlobalUnlock(hDevMode);
}
dc.Attach(dlg.GetPrinterDC());
dc.DeleteDC();
}
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..."
|
|
|
|
|
Doesn't work on all printers, on many it sets the paper size to deafult. I also need to get the orginal paper sizes from devmode, but it doesnt always report them correctly (sometimes both are 0).
|
|
|
|