|
can you could just put the text into a const char * variable?
when you write your text file, make it look like this:
---begin (cut here)
const char *pTheTextFile = "JUKFDSSA";
---end (cut here)
... and call it "MyText.cpp" (or whatever) and add it to your project. then just rewrite it when you want to add the other person's data.
-c
"Kate said / The flowers of intolerance and hatred / Are blooimg kind of early this year / Someone's been watering them.
-- Robyn Hitchcock, Devil's Radio
|
|
|
|
|
I have a big problem and i must finish this work:
send and receive some bitmap.
The solution?
Thanks
|
|
|
|
|
Oh please, you have been talking about sending this bitmap for several days now. I remember a few days ago someone actually wrote some nice code, in a reply to your question.
Have you been looking at that?
I don't think you get anyone to write a complete program for you, by asking the same question every day.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I have a dialog with two listboxes in it. I want my listboxes to do something when the "enter" key is pressed. The LBN_* messages listed in the ClassWizard are of no help. I tried responding to WM_KEYUP/DOWN messages from the parent dialog, but the didn't work either. How can I know when the user hits "enter" from a listbox?
|
|
|
|
|
|
Hi there,
I respond to "del" keys in my listviews by handling the KEYDOWN notifications, this solution should also work for listboxes:
In your message map add: (you should use LBN_*)
ON_NOTIFY(LVN_KEYDOWN, IDC_LIST_FILES, OnKeydownListFiles)
Add the handler:
void CUpdateDlg::OnKeydownListFiles(NMHDR* pNMHDR, LRESULT* pResult) <br />
{<br />
LV_KEYDOWN* pLVKeyDow = (LV_KEYDOWN*)pNMHDR;<br />
if (pLVKeyDow->wVKey == 46)<br />
{<br />
}<br />
<br />
*pResult = 0;<br />
}
Hope this helps !
Alwin
|
|
|
|
|
Override CYourDlg::PreTranslateMessage, check if listbox has the focus and key is Enter, then do whatever you want.
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|
|
Hello
I am trying to create a c++ program thats outputs messages to disk in a fixed lenght format i.e after each record the data needs to be padded to 512 bytes before the next record starts.
The part I have trouble with it the padding of the record to 512 bytes can anyone help or point me in the right direction
Thanks
James Wright
|
|
|
|
|
Copy the message to 512-byte buffer, then write buffer to disk.
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|
|
Sorry I am a bit of a retard when it comes to programming I only started to learn last week.
what command would I use because I need to pad it with hex code 20
Thanks
James
|
|
|
|
|
What kind of message are you writing? Text messages, binary messages?
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|
|
text this is what I have so far
stream tmpFile("tmpfile", ios::trunc);
tmpFile << "\x01"<<"{1:F01"<
|
|
|
|
|
using namespace std;
ostringstream os;
os << "\x01"<<"{1:F01"<<senderbic<<"0000000000}{2:I"<<mttype<<receivebic<<"X}{4:";
os << "\x0A"<<"\x3A"<<"20:MT999 TEST "<< loop;
os << "\x0A"<<"\x3A"<<"21:DOS-PCC TEST";
os << "\x0A"<<"\x3A"<<"79:TEXT Field";
os << "\x03";
string padding(512 - os.str().length(), 0x20);
os << padding;
ofstream of("c:\\test.txt", ios::out | ios::app);
of << os.str();
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|
|
Thankyou Iam very new to programming but have been searching for ages for this
Thanks
|
|
|
|
|
Hi,
I have my Visual C++ 6.0 application Trial.exe & MS Acces databse table Trial.mdb
*) These steps I did try at my friend PC (Window 98 & without Jet DAO engine) as
article Q23002 suggested:
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q233002
1) Run MDAC_TYP.exe
2) Reboot PC
3) Jet40Sp3_Comp.exe
4) Reboot PC
5) Copy my Trial.exe Trial.mdb in c: drive as needed
6) Run Trial.exe & the PC said: "Can not initialize DAO Jet 4.0"
*) However, I did not perform those with Regsvr32 Dao360.dll in c:\Program
Files\Common Files\Microsoft Shared\DAO to become COM.dll ... because I am
not sure how to do it ! I did try do it in DOS environment c:\Windows\System
as Regsvr32 Dao360.dll), but the result is the same in (6)!
*) Do you think I need in DOS environment C:\Program Files\Common
Files\Microsoft Shared\DAO: "Regsvr32 Dao360.dll COM.dll"?
Can anyone help me, I need it for this afternoon!
Many thanks,
|
|
|
|
|
I'm having trouble with the LPBYTE param of this API.
I want to move text from my dialog based application to this api to send.
LPTSTR buffer;
m_cSendText.GetWindowText(buffer, 256);
nasStatus = NetMessageBufferSend(NULL,
awcToNameW,
awcFromNameW,
(LPBYTE)buffer,
256);
When I run my program all I get is a string of ?'s. How do I setup the 4th param so that it sends the text properly?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Okay I found that I did not have this set correctly is should be
CString buffer;
m_cSendText.GetWindowText(buffer);
nasStatus = NetMessageBufferSend(NULL,
awcToNameW,
awcFromNameW,
(LPBYTE)&buffer,
m_cSendText.GetWindowTextLength());
But I'm still getting junk in the message box. Any suggestions?
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
The problem is the unecessary & to take the address of the CString object. If you only need read access to the string data in a CString object, you can use the (LPCTSTR) conversion operator to get a pointer to the buffer. Then you'll have to use a cast, because NetMessageBufferSend() expects an LPBYTE rather than an LPCTSTR. That is, change
(LPBYTE)&buffer,
to
(LPBYTE)(LPCTSTR) buffer,
Casting away the constness of the LPCTSTR doesn't matter in this case, since NetMessageBufferSend () is only going to read the buffer.
Stephen C. Steel
Kerr Vayne Systems Ltd.
|
|
|
|
|
No this still does not work. I must not be setting something up right.
I have a dialog based app with 2 edit fields on it. And a control variables called:
m_cCompName.
m_cSendText.
LPWSTR awcToNameW;<br />
LPWSTR awcFromNameW;<br />
CString ComputerName;<br />
<br />
awcToNameW = T2W(ComputerName);<br />
awcFromNameW = T2W(ComputerName);<br />
NET_API_STATUS nasStatus;<br />
<br />
nasStatus = NetMessageBufferSend(NULL,<br />
awcToNameW,<br />
awcFromNameW,<br />
(LPBYTE)(LPCTSTR)TextSend,<br />
TextSend.GetLength());<br />
<br />
So what am I doing wrong. This should work. Right?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Usually NetXXX Api never use ANIS strings. Even if not explicitly mentioned in MSDN, I would try to convert the message buffer also to UNICODE.
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
That's what I ended up doing.
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
I want to know whether this is possible to access RAM through VC++? If yes then can i read or write data in RAM?
Please reply soon........
Samir Sood
|
|
|
|
|
Almost whatever you do in C++, you access RAM Of course you can only access memory managed by your process, otherwise your program will generate "Access violation" exception.
Vagif Abilov
MCP (Visual C++)
Oslo, Norway
Hex is for sissies. Real men use binary. And the most hardcore types use only zeros - uppercase zeros and lowercase zeros.
Tomasz Sowinski
|
|
|
|
|
You can access all memory mapped to application address space, randomly mapped to physical RAM by OS. If you need to access a physical RAM, you need to go down to driver level, if it's possible at all.
Pavel
Sonork 100.15206
|
|
|
|
|
Can u provide me with some api level information for it
Samir Sood
|
|
|
|