|
I want to insert a new line between subjects in a CString variable.
For example, instead of
"Grade A Grade B Grade C"
I want the text saved in a database as
"Grade A
Grade B
Grade C"
I tried doing something like this
str1 + '\n' | str2 + '\n' + str3
But this does not insert a new line.
-Elizabeth
Eilzabeth
|
|
|
|
|
Elizabeth Chang wrote:
I tried doing something like this
str1 + '\n' | str2 + '\n' + str3
Can you please post the exact code you are using?
What database are you using? Some databases may expect a carriage-return line-feed pair for the end of a line (that is "\r\n" or 0x0d0a).
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
The string "\r\n" works on both saving to the database (Oracle) and displaying on a CEdit control. Here is the syntax I used:
str1 + "\r\n" + str2 + "\r\n" + str3
Thank you.
-Elizabeth
Eilzabeth
|
|
|
|
|
Check out <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/vcrefcstringinsert.asp">CString::Insert</a>[<a target=_blank title='New Window' href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/vcrefcstringinsert.asp">^</a>]
-Nick Parker
|
|
|
|
|
Any one knows how to format text from a static control, such as text in a dialog box. I'd like to be able to bold, subscript, italicize,... the text. Thx,
Ralf.
ralf.riedel@usm.edu
|
|
|
|
|
|
I have MDI MFC+ATL app. Application supports scripting ( SmartHost etc) VbScript/Jscript.
Vb/J Script requires all calls to come from the same thread (except InteruptThread)...
Obvious solution is to create dedicated thread, this thread will waitForSingleObject(command). Once command recieved thread will execute code and return data to caller thread.
Caller thread will be blocked via semaphore or event until execution completed.
Is there a similiar com solution? Multiple callers - single thread execution?
B
|
|
|
|
|
Hello.
I have a very preposterous problem. I have a ListView class.
Sa i want when i click on a column in the header control, an event to be manipulated in my ListView class. So i thought the clear decision is to use ClassWizard and to add a message handler for the event HDN_ITEMCLICK :
this is the method generated by ClassView
<br />
void CRegDlg::OnItemclickList1(NMHDR* pNMHDR, LRESULT* pResult) <br />
{<br />
HD_NOTIFY *phdn = (HD_NOTIFY *) pNMHDR;<br />
AfxMessageBox("a");
*pResult = 0;<br />
}<br />
Yes, but ... noo. When i press a header control column nothing happens ?
Why it is?
Can anyone help me.
|
|
|
|
|
I've created an explorer bar two different ways...one way using registry settings and another using ATL and COM. Both ways show up when I click a button on the toolbar. I want to show an HTML page in the explorer bar. This is easy with the registry settings, but I need to do other processing as well, which I don't know how to do with the registry solution. The ATL COM way I don't know how to get the HTML page to show up but I can do the other processing.
My question is: does anyone know either know how to get ahold of the explorer bar that is created by the registry entries so I can do additional processing (if that's even possible)? Or can anyone give me some advice on how to show an HTML page in the explorer bar I've created using ATL COM?
Thanks for your help.
Melinda
|
|
|
|
|
I am trying to set the fields of the packet which I am sending using winpcap But I am unable to set the true fields of ethernet packet using winpcap.
These fields are
pcap_data[0]...........pcap_data[5] //ethernet destination address
pcap_data[6]...........pcap_data[11] //ethernet source address
I am setting in these fields with the Mac of source and destination like
1 pcap_data[0]=00;
2 pcap_data[1]=50;
3 pcap_data[0]=8D;
But line 3 is giving errors I do not know exactly what to fill I s it Hexadecimal or binary or anything else
Please help me with certain example that may be sending packet or help me in solving the problem.
Reply me soon
|
|
|
|
|
Hi, I am a newbie to programming. Need to program a video conference application, that sends the video from the local to the other side connected by LAN. Needs to preview the window locally as well.
I have managed to do that, using <vfw.h>, using Win32 API programming style. Only the preview i mean.
Having difficulty to get the "previewed" video to be sent over the other end, using sockets i suppose. Dun have any idea how to implement this.
I looked up Netmeeting SDK already, but am not able to make use of that, because i need to tweak my video frames when they are being sent out, according to different configurations. Thus, i have to implement my own.
On a tight schedule now, everything with the GUI needs to be done in 3 weeks time, still blur with programming. Hope some kind soul out there able to shed some light.
Thanks and regards.
p.s-> pls send email to <extremalis@catcha.com>
extremalis
|
|
|
|
|
Found it on PSC:
http://www.planet-source-code.com/vb/scripts/BrowseCategoryOrSearchResults.asp?optSort=Alphabetical&blnWorldDropDownUsed=TRUE&txtMaxNumberOfEntriesPerPage=10&blnResetAllVariables=TRUE&lngWId=1&txtCriteria=netmeeting
|
|
|
|
|
Tks for the tip. However, jus to note, this programme in VB does not include the "video streaming" codes both in the exe version and the compilable version. So its not that free afterall.
Anyway, thank you for this tip.
|
|
|
|
|
|
I created a VC++ app that calls a VB created ActiveX DLL, but its returns a failure when I execute the CoCreateInstance function for the COM handle.
|
|
|
|
|
Did you call the CoInitialize or CoInitializeEx on the beginning of your application? (every thread - including main thread of the application must have initialize the support for COM subsystem to be able to use it)
|
|
|
|
|
Yes, I did call the CoInitialize at the beginning of the app. Does the CoCreateInstance work differently in NT as opposed to Win2000 because when I run my app in NT, it seems to run through this step without an error message, but in Win2000 this step generates an error
|
|
|
|
|
normally not - what exactly the CoCreateInstance returns to you as an error - this HRESULT value?
|
|
|
|
|
I need to identify any and all SCSI devices attached to a system, whether it's a scanner, CDROM, hard drive, tape drive, etc.
I've been looking at:
CreateFile( "\\.\SCSIx:", ... ); // x = some int
DeviceIoControl( ..., IOCTL_SCSI_GET_INQUIRY_DATA, ... )
...however this seems to pick up all storage devices...regardless of whether the device is truly SCSI or not (ie, it'll pick up my IDE hard drives, IDE CDROM drives and even virtual IDE CDROM drives).
None of the buffers that get filled in seem to have any indicator of being a "true" SCSI device or not...
What *is* the proper way to iterate through the "real" SCSI chain from a user-mode app written in C/C++?
|
|
|
|
|
|
I'm trying to implement the compareitem and drawitem for a combobox. The compareitem is called when I call addstring, but in the drawitem i'm not getting the correct string values. Any ideas.
Thanks
|
|
|
|
|
Can you please be a bit more specific? What are the incorrect values you are getting, and what do you expect there? What is the code you are using to draw the item?
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
The CompareItem Function seems to work fine. I can't get the DrawItem to display the sorted data.
void CCBX::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
// TODO: Add your code to draw the specified item
ASSERT(lpDrawItemStruct->CtlType == ODT_COMBOBOX);
LPSTR lpszText = (LPSTR)lpDrawItemStruct->itemData;
CDC dc;
dc.Attach(lpDrawItemStruct->hDC);
dc.DrawText(lpszText, strlen(lpszText),
&lpDrawItemStruct->rcItem,DT_SINGLELINE);
dc.Detach();
}
Thanks
|
|
|
|
|
I want to set focus in the edit part of the combobox after I select an item from a listCtrl. SO I have in:
OnItemChanged()
{
GoToDlgCtrl(GetDlgItem(IDC_COMBO1)->GetDlgItem(1001));
When I have the mouse button clicked down (and not yet released back up) while I am in the listCtrl making my selection, the focus does go to the combo editpart. I see the cursor blinking there. The moment I release the mouse the focus vanishes, and the item I selected looks highlighted in blue. How do I make my focus stay in the combo? I even tried postMessaging from within the ItemChanged to setFocus but that didnt do it either....
Appreciate your help,
ns
Of course I had tried the m_combo1.SetFocus() too but no go..
|
|
|
|
|
I need a dialog to lock my app, at the same time I locked desktop, so no one can run another app, but F1 key can not disable successfully, when I press F1, it pass through my dialog and to CxxApp, which generate WM_HELP by default, I want to avoid it in this situation, How can I do it?
BOOL CLockDlg::PreTranslateMessage(MSG* pMsg)<br />
{<br />
if(pMsg->message==WM_KEYDOWN)<br />
{<br />
switch(pMsg->wParam)<br />
{<br />
case VK_ESCAPE: return TRUE;<br />
<br />
}<br />
} <br />
<br />
return CDialog::PreTranslateMessage(pMsg);<br />
}<br />
Thank you in advance.;)
Best Regards
|
|
|
|