|
I have found what I'm looking for.
Thanks self.
"You will be killed by a poisoned fortune cookie." - Old fortune cookie proverb
|
|
|
|
|
Can anyone please help me!!
i am looking for some simple C++ code to validate isbn numbers. i have no clue where to start
THANK-YOU!!
James
|
|
|
|
|
|
|
i want to modify the window caption,i know to use
AfxGetMainWnd ( ) —> SetWindowText (_T("Application title") )
but when i write it in BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
but when i doesnt run note warning box
|
|
|
|
|
you can not use AfxGetMainWnd ( ) —> SetWindowText (_T("Application title") ) in PreCreateWindow because as the method name indicates that the window has not yet been created so the call will fail or will not work.
Regards.
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
first i create button control in tool,id:IDP_PLACEHOLDER2
second:derive a CMainToolBar from ctoolbar
in mainfrm.h declare CMainToolBar m_wndToolBar;
in MainToolBar:public:CComboBox m_wndSnap;
in mainfrm.cpp oncreate:
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{#define SNAP_WIDTH 80 //the width of the combo box
int index;
CRect rect;
//set up the ComboBox control as a snap mode select box
//
//First get the index of the placeholder's position in the toolbar
index = 0;
while (m_wndToolBar.GetItemID(index) != IDP_PLACEHOLDER2) index++;
//next convert that button to a seperator and get its position
m_wndToolBar.SetButtonInfo(index, IDP_PLACEHOLDER2, TBBS_SEPARATOR,
SNAP_WIDTH);
m_wndToolBar.GetItemRect(index, &rect);
//expand the rectangle to allow the combo box room to drop down
rect.top+=2;
rect.bottom += 200;
// then .Create the combo box and show it
if (!m_wndToolBar.m_wndSnap.Create(WS_CHILD|WS_VISIBLE|CBS_AUTOHSCROLL|
CBS_DROPDOWNLIST|CBS_HASSTRINGS,
rect, &m_wndToolBar, IDC_SNAP_COMBO))
{
TRACE0("Failed to create combo-box\n");
return FALSE;
}
m_wndToolBar.m_wndSnap.ShowWindow(SW_SHOW);
//fill the combo box
m_wndToolBar.m_wndSnap.AddString("SNAP OFF");
m_wndToolBar.m_wndSnap.AddString("SNAP GRID");
m_wndToolBar.m_wndSnap.AddString("SNAP RASTER");
m_wndToolBar.m_wndSnap.AddString("SNAP VERTEX");
m_wndToolBar.m_wndSnap.AddString("SNAP LINE");
m_wndToolBar.m_wndSnap.SetCurSel(0);
return 0;
}
,in fact,the program above is from randymore in cp articles.why when i compile no error,but when i run,pop a waring box.
the below is debug info:
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
Loaded symbols for 'C:\WINDOWS\system32\MFC42D.DLL'
Loaded symbols for 'C:\WINDOWS\system32\MSVCRTD.DLL'
Loaded 'C:\WINDOWS\system32\gdi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\user32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found.
Loaded symbols for 'C:\WINDOWS\system32\MFCO42D.DLL'
Loaded 'C:\WINDOWS\system32\imm32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\lpk.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\usp10.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\mfc42loc.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\uxtheme.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\hookdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\MSCTF.dll', no matching symbolic information found.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
Loaded 'C:\WINDOWS\system32\PINTLGNT.IME', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\oleaut32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ole32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\secur32.dll', no matching symbolic information found.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
Loaded 'C:\WINDOWS\system32\shlwapi.dll', no matching symbolic information found.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (HOOKDLL.DLL): 0xC0000005: Access Violation.
Loaded 'C:\WINDOWS\system32\shell32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\comctl32.dll', no matching symbolic information found.
Loaded 'C:\Program Files\MyWebSearch\bar\1.bin\MWSOESTB.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\version.dll', no matching symbolic information found.
Detected memory leaks!
Dumping objects ->
strcore.cpp(118) : {72} normal block at 0x00421240, 23 bytes long.
Data: < 517t> 01 00 00 00 0A 00 00 00 0A 00 00 00 35 31 37 74
strcore.cpp(118) : {71} normal block at 0x00421290, 71 bytes long.
Data: < : : 517t> 01 00 00 00 3A 00 00 00 3A 00 00 00 35 31 37 74
F:\control learing\517toolbar\MainFrm.cpp(18) : {70} client block at 0x00421310, subtype 0, 544 bytes long.
a CMainFrame object at $00421310, 544 bytes long
F:\control learing\517toolbar\517toolbarDoc.cpp(18) : {69} client block at 0x00421560, subtype 0, 84 bytes long.
a CMy517toolbarDoc object at $00421560, 84 bytes long
plex.cpp(31) : {68} normal block at 0x004215E0, 124 bytes long.
First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
Data: < ` B > 00 00 00 00 00 00 00 00 00 00 00 00 60 17 42 00
{67} First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
client block at 0x00421690, subtype 0, 32 bytes long.
a CDocManager object at $00421690, 32 bytes long
First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
strcore.cpp(118) : {66} First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
normal block at 0x004216E0, 71 bytes long.
Data: < : : 517t> 01 00 00 00 3A 00 00 00 3A 00 00 00 35 31 37 74
First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
F:\control learing\517toolbar\517toolbar.cpp(76) : {65} First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
client block at 0x00421760, subtype 0, 108 bytes long.
a CSingleDocTemplate object at $00421760, 108 bytes long
First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
strcore.cpp(118) : {63} First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
normal block at 0x00421800, 19 bytes long.
Data: < File> 01 00 00 00 06 00 00 00 06 00 00 00 46 69 6C 65
First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
strcore.cpp(118) : {62} First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (MSCTF.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (KERNEL32.DLL): 0xC0000005: Access Violation.
normal block at 0x00421840, 29 bytes long.
Data: < Rece> 01 00 00 00 10 00 00 00 10 00 00 00 52 65 63 65
First-chance exception in 517toolbar.exe (KERNEL32.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (KERNEL32.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (KERNEL32.DLL): 0xC0000005: Access Violation.
{61} normal block at 0x00421890, 20 bytes long.
First-chance exception in 517toolbar.exe (KERNEL32.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (KERNEL32.DLL): 0xC0000005: Access Violation.
First-chance exception in 517toolbar.exe (KERNEL32.DLL): 0xC0000005: Access Violation.
Data: < L_ L_ L_> 04 00 00 00 14 CB 4C 5F 14 CB 4C 5F 14 CB 4C 5F
{60} normal block at 0x004218D0, 32 bytes long.
Data: << K_ B L B > 3C 8D 4B 5F 04 00 00 00 94 18 42 00 4C 18 42 00
Object dump complete.
The thread 0x520 has exited with code 3 (0x3).
The program 'F:\CONTROL LEARING\517toolbar\Debug\517toolbar.exe' has exited with code 3 (0x3).
,can someone give me some instruction ,i am puzzled.thx all.
|
|
|
|
|
ive created an application which uses the CStatusBar class, its about half the size of the desktop and once the status bar is created i have to maximise the window to see it, does anyone know why?
Also, i have a toolbox at the top now if i use OnSize it overwrites the toolbox and it becomes blank, does anyone know why?
Any help appreciated
Regards.
Ash.
|
|
|
|
|
To best get help with this question, you should post your status bar creation and docking code.
Roger Allen - Sonork 100.10016
Strong Sad: I am sad I am flying
Who is your favorite Strong?
|
|
|
|
|
below is a link for a "character set" setting...
"character set"
please explain what different values for this seting mean...
i making a unicode-aware program and i have a message box which supposed to show message in russian...
i found out that value of the above setting ("character set") if set to "unicode" makes the russian message unreadable whle with other two values message box shows correct text....
and on the same subject...
if i write in VS editor text say on russian or in chinese, when the program compiles what will be the nature of strings? will they be a unicode string=wide-character string?
thanks
|
|
|
|
|
String literals in C/C++ are always char arrays. If you want unicode (i.e. UTF-16), you'll need wchar_t arrays. You do this by prepending the L character to your strings literals.
e.g.
char * ascii_hello = "Hello World"; // ASCII
wchar_t * wide_hello = L"Hello World"; // UTF-16
The "character set" choice in the settings affects which versions of API functions are called. If it's set to unicode, it will call (for example) MessageBoxW() rather than MessageBoxA() (which would be for ASCII) whenever your code says to call MessageBox().
- C_G
P.S. I believe the A actually stands for ANSI, rather than ASCII, but no matter.
|
|
|
|
|
hi im looking to figure out how to make list boxes similar to the control in the windows xp task manager in the process tab anyone know how to create a list box like that if someone could just point me to an article or something that would be very helpfull thanks
|
|
|
|
|
What you're wanting is a ListView control, using the Report View style.
Microsoft has some examples of how to create/use the ListView control here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/listview/listview.asp
If you're wanting to use MFC, or .NET, a Google search will probably turn up some equally useful documentation.
|
|
|
|
|
Hey,
I am developing a program for this one guy, and I was wondering what you need to do to get it to run on another computer that doesn't have Microsoft Visual c++ on it.
Thanks
|
|
|
|
|
How about compiling in Release mode?
modified 12-Sep-18 21:01pm.
|
|
|
|
|
|
or make it staticly linked library and not a shared mfc dll
|
|
|
|
|
|
what are we expected to help you for ?
be careful when you write your post with <> beacause they are treated as HTML tags, and so, not displayed. Use you modify button to rewrite a post...
TOXCCT >>> GEII power
|
|
|
|
|
I want to include my in 'Visual C++' - written Dll in a VB-Project and use its functionality.
But some of the methods of my Dll have 'char*' pointers in their paramter list, which is why, the functions are not displayed or not working from VB.
I also tried using a CString with the same effect.
Can anybody please tell me, how to handle this simple problem??!?
dalecooper241
|
|
|
|
|
do you use COM or make a DLL and expose it's functions like APIs ?
if COM then use BSTR(basic string) for strings.
Ig API try using constant length strings.
|
|
|
|
|
Actually, I am using a DLL and I want to acces its functions from VB.Net.
Can you please give me an example, how to modify the codelines, so that the functions will be supported/accesible from VB?
C++:
public class ChatService{
...
int sendMessage(int iAddress, char* pcMessage);
}
|
|
|
|
|
Hi all;
I have followed the instructions in MSDN for creating a bitmap button on a dialog box:
that is, I have drawn my bitmaps and named them accordingly with suffixes "U", "D", "F" and "X".
Then I have drawn my button on the dialog box, checking "Owner draw" in properties and with caption the name of the bitmaps without the above suffixes.
I have named a variable of type CBitmapButton in the dialog class and called the AutoLoad in 'OnInitDialog()' function as follows:
VERIFY(okBtn.AutoLoad(IDOK, this));
And I get an "ASSERT" error at this line:
ASSERT(FromHandlePermanent(hWndNew) == NULL);
What's the problem and what can I do?
_Lostris.
|
|
|
|
|
Hi there,
I have a requirement within a C++ MFC project to simulate the clicking of a button control from within a function in my app.
For this control, I have an OnButton1 message handler for the BN_CLICKED message. Obviously, when this button is clicked, the associated code within this handler is executed. However, I also want to be able to call this handler from within another function, thus simulating the user clicking this control. I understand that I need to send a BN_CLICKED message using the SendMessage function. For example:
void CMessagesDlg::OnButton1()
{
CString text = "The BN_CLICKED message was sent to the IDC_BUTTON1 control";
MessageBox(text);
}
void CMessages::OnButton2()
{
CWnd *pCalc = NULL;
pCalc = GetDlgItem(IDC_BUTTON1);
pCalc->SendMessage(BN_CLICKED);
}
The idea here is the user can click button1 to have the text string displayed. But also, the user can click button2 to display the same text string, by sending the BN_CLICKED message to the button1 control
Whilst the above code compiles, links and is free of run-time errors, nothing actually happens when the user clicks button2!!
What could I be doing wrong - any advice is greatly appreciated
Adrian Langford
|
|
|
|
|
Here is one solution.
::SendMessage(hWnd, WM_COMMAND, MAKELONG(ButtonID, BN_CLICKED), reinterpret_cast<lparam>(ButtonHandle));
kuphryn
|
|
|
|
|