|
I think allocating a buffer that's long enough to store previous data could also work.
|
|
|
|
|
Thanks for the reply. I have already thought of this solution but i searched the simplest one. Ok, i'll try using a temporary file
|
|
|
|
|
Be sure you have write access to the folder in which the temporary file will be created. If the file is not gigantic (e.g., 100MB or more), you could just read it into a heap-based buffer, write the new text to the file and then append the contents of the buffer. That's about as simple as it gets.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
is it possible to read icon (resource) info from an exe file directly without using resource functions such as ::FindResource()?
thx
includeh10
|
|
|
|
|
Sure, but it would require intimate knowledge of the PE file format.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I have made a DSP program that reduces a wave file size.
Now i want to be able to play it on the fly as a unpack it the new soundformat.
Been trying to figure out how to play it with directsound, but havent had much luck, and resources for setting this up is sparse.
Does anyone have a working example/link/tutorial, that does the following or explains how to make it.
Takes a block of PCM data, for instance 256 bytes.
Puts it in a buffer
The audio device plays the data in the buffer without gaps.
Have some trouble getting the larger picture, of how it should be set up, from reading MSDN explanation. Im all new to directx.
Thx in advance
|
|
|
|
|
I have developed an applications (MFC Dialog based) - uses buttons, picture box, edit box and radio button (some of the buttons use a BitmapButton class).
Now I would like to turn this program into a class as I need multiple instances of it and that would be ideal just to instantiate this class as many times as needed.
How do you go about converting a program to a class where they are many files used to build the original program?
Regards,
|
|
|
|
|
make your dialog ( and all its dependencies ) a DLL.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Thanks for the post, I have had a re-think.
As the first dialog needs to do some special processing can I create another couple of dialogs (based on the first), but with different initialisation.
i.e. can you during the MFC dialog's Init routine create another dialog
I did try but got the error:-
<code>g_pIDU[0] = this;
for(int q = 1; q < 4; q++)
{
g_pIDU[q] = new CIDU_Dlg(this);
g_pIDU[q]->Create(CIDU_Dlg::IDD, GetDesktopWindow());
g_pIDU[q]->InitNextDlg ();
g_pIDU[q]->ShowWindow(SW_SHOW);
g_pIDU[q]->SetActiveWindow();
} c:\\IDU_Dlg.cpp(734): error C2039: 'InitNextDlg' : is not a member of 'CBDialog'
Where 'InitNextDlg' is the Init for the other 3 dialogs.
|
|
|
|
|
Hi,
I have noticed a strange behaviour in my app.
I have 4 staic items:
static char* manuf[512];
static int link_man[512];
static char* comp[128];
static CDatasheet DS;
where CDatasheet is a class derived from CObject.
Filling in the manuf array, when I reach the 264th item, the app starts overwriting the memory space allocated for the DS object. So any assignment operation to that object produces an error.
Any suggestion?
Another question:
I tried to remove the DS object (commented out), but the compiler still build the app. I parsed all my files, but there are no other declaration for that object. What can it be happened?
Thanks
Dwarfpower
|
|
|
|
|
vilmer wrote:
static char* manuf[512];
vilmer wrote:
Filling in the manuf array, when I reach the 264th item, the app starts overwriting the memory space allocated for the DS object. So any assignment operation to that object produces an error.
How are you filling the array ? You know that manuf is an array of pointers, and not a string ? You have an array of 512 'strings' that are undefined (that is all adresses are invalid at the begining).
Post the code, so maybe we can help you.
|
|
|
|
|
Code is
manuf[i] = strdup("Hello");
the function provides to create a location of memory where it copies the string and writes the address of that location on the pointer manuf[i]
|
|
|
|
|
Hi all,
I have the following read/write program.
typedef struct
{
string s1;
string s2;
} Names;
int main
{
fstream fout("data.dat", ios::in | ios::out | ios::binary);
Names name;
name.s1.assign("abc");
name.s2.assign("xyz");
fout.write((char*)name, sizeof(Names));
fout.close
}
And then, I create another program to read this file
int main
{
fstream fin("data.dat", ios::in | ios::binary);
Names *name = new Names();
fin.read((char*)name, sizeof(Names));
// --> Till here, it's Ok. But if I want to access the struct. For example:
cout << name->s1.c_str() << endl;
fout.close
}
The strange thing is that, if I combine write and read file in one program, then no problem. But if I creat2 2 differenct programs, there's problems.
Can anyone help me out?
THank you in advance
|
|
|
|
|
int main
{
fstream fout("data.dat", ios::in | ios::out | ios::binary);
Names name; <--- not a pointer
name.s1.assign("abc");
name.s2.assign("xyz");
fout.write((char*)name, sizeof(Names)); <--- never thought you can cast
fout.close a structure to a pointer to
} char.
Either this works for weird reasons, or you made a mistake copying (char *)&name.
|
|
|
|
|
Recently I am writing a voice chatting program,I want to compress audio data before sending it to the other computer,could you help me?
|
|
|
|
|
When it is speech, you dont need as many bits to represent the sound. if its 16, use 8 instead, or even lower perhaps.
|
|
|
|
|
coulde you give me some details?thanks a lot
|
|
|
|
|
Usually speech doesnt need alot of bits to be audible.
If you record speech with 16 bit, try and reduce it.
|
|
|
|
|
|
Hi!
I had created an OLE Automation Server ( the out put is in the form of DLL). How can I use that dll in the Client Machines.
Thanks in Advance.
|
|
|
|
|
Hi ,
Exports the functions u want from DLL!
Regards,
Vishal
|
|
|
|
|
Thanks Vishal,
But I'm not using Pure DLL.
STDAPI DllRegisterServer(void)<br />
{<br />
<small> AFX_MANAGE_STATE(AfxGetStaticModuleState());<br />
COleObjectFactory::UpdateRegistryAll();<br />
return S_OK;</small><br />
}
The above function is automatically implemented by the MFC class wizard.( During the add new class using class wizard, I had created a class which is derived from the CCmdTarget and also I added automation support for it)
But, I can't find any default code support for Dllunregister server. How do I implement code for DllunregisterServer.
|
|
|
|
|
i am getting this message "bad dll calling convention" when i am using openprocess from my vb code.
why?
|
|
|
|
|
Probably because functions exported from your DLL were not written in VB
Ryan "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"
|
|
|
|
|
Hi all,
Im new to VC++, so i would like to ask how to write a data i store to a text file?
below are part of my code:
FILE *fp1;
Boolean Stats
if(Stats)
{
printf("number of my phone is %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
(PCHAR)(Phone->Data)[0],
(PCHAR)(Phone->Data)[1],
(PCHAR)(Phone->Data)[2],
/* how do i write the Data into My text file*/
fp1 = fopen("Phone.txt","w");
}
Thanx for the advance help.
thanx
|
|
|
|