Visual C++ :: Adding Splitter Windows Makes Mainframe Unable To Get Current Document

Apr 7, 2014

I created two split views like this:

BOOL CMainFrame::OnCreateClient( LPCREATESTRUCT lpcs, CCreateContext* pContext ) {
CFrameWnd::OnCreateClient(lpcs, pContext);
if (!m_wndSplitter.CreateStatic (this, 2, 1) ||

[Code]....

When I step into CMainFrame::OnAlohaHowAreYou(), I found m_pDoc is NULL. If I remove the split views and make CMainFrame::OnCreateClient() like below, then there is no problem.

BOOL CMainFrame::OnCreateClient( LPCREATESTRUCT lpcs, CCreateContext* pContext ) {
CFrameWnd::OnCreateClient(lpcs, pContext);
return TRUE;
}

View 14 Replies


ADVERTISEMENT

C++ :: Windows Socket Makes App Crash If No Internet Connection

Oct 18, 2014

I'm strugling to understand why my app is crashing if there is no internet connection.

Code:
int main() {
WSADATA wsaData;
if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) {
std::cout << "WSAStartup failed.

[Code] ....

Debug crash code:

Code:
First-chance exception at 0x00161831 in ConsoleApplication1.exe: 0xC0000005: Access violation reading location 0x0000000C.
Unhandled exception at 0x00161831 in ConsoleApplication1.exe: 0xC0000005: Access violation reading location 0x0000000C.

It works well as long as the computer is connected to internet but if i disconect from internet the application crash but don't understand why.

View 4 Replies View Related

Visual C++ :: Change Menu Bar Font Size In Mainframe

Jul 30, 2014

Can change the menu bar font size in CMainFrame::OnCreate()? Here's what I have:

Code:

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) {
CRect rect;
GetClientRect(&rect);
if (CFrameWnd::OnCreate(lpCreateStruct) == -1) {
return -1;

[Code] ....

The line "m_wndToolBar.SetFont(&m_font);" does nothing.

View 2 Replies View Related

Visual C++ :: WTL - Handle Splitter Position Changing

Sep 6, 2013

How can I handle splitter position changing?

View 2 Replies View Related

Visual C++ :: Frozen Grid In CView Of SDI Splitter

Sep 14, 2013

I have been working with both Chris Mander's MFC grid and the Ultimate Grid.

See for details:

The Ultimate Grid Beginner's Guide By The Ultimate Toolbox, 25 Aug 2007 : [URL] ....

MFC Grid control 2.27 By Chris Maunder, 6 May 2010 : [URL] ....

Both of these grid controls work nicely in a SDI CView windows. But when I create a split window using CSplitterWnd and the following code in an attempt to create a split window with a CListView and and a CView using this code:

Code:
// in CMainFrame.h
// Attributes
public:
CSplitterWnd m_wndSplitter;
//..
// in CMainFrame.cpp
//..
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)

[Code] .....

The grid in the CView window appears but is frozen in both instances. I suspect there is some notification necessary to for the grid to send and receive messages from the split CView window, but I cannot figure out how to implement this notification.

Unfortunately, even a demo application would be too large to append, but for anyone that is interested, the split method is encapsulated in the code I've presented here and the implementation of both grid controls is well explained in the links provided.

View 6 Replies View Related

C++ :: Adding Current Date To The End Of A String

Dec 12, 2014

I need to add the current date to the end of a string but I only need to add the day and not the year or month.

Put the code This is what i have

char date[9];
_strdate(date);
cout << date << endl;

View 1 Replies View Related

C++ :: Unable To Read A Certificate In Windows Store From Console Application

Sep 23, 2014

I have been struggling to read a certificate in windows store from C++ DLL, but its not happening. from console application I can but when same code built as a DLL and tried to access from a separate console application. I think its not going to windows store to read the cert.

pCertContext = CertFindCertificateInStore((HCERTSTORE)*pCertStore, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, 0, CERT_FIND_ISSUER_OF, operator PCCERT_CONTEXT(), pCertContext);
int Error = GetLastError();
if (Error == 0)
LINFO << "
Signtuare is valid
";
else
LINFO << std::hex << Error << '
' << "GetLastErrorStdStr=
" << GetLastErrorStdStr();

it returns 80092004 GetLastErrorStdStr= C a n n o t f i n d o b j e c.

View 1 Replies View Related

Visual C++ :: How To Handle Open Document

Oct 11, 2012

I have an MFC program created from the app wizard. It is an MDI program, reading/writing text files using Serialize. I can read the document and know that the entire document was read into my buffer without any errors. This was verified by compaing the number of bytes read with the file length.

How do I get the document to display in my main/child window?

How do I read the document from the window so I can save it back to the file?

View 14 Replies View Related

Visual C++ :: Breakpoints Will Not Be Hit - No Symbols Loaded For Document

Apr 10, 2013

I am using Visual Studio 2010 with WindowsXP 32 bit. when i placed break points in my solution and trying to debug then i am getting THE BREAKPOINTS CAN NOT BE HIT NO SYMBOLS HAVE BEEN LOADED FOR THIS DOCUMENT issue.

View 2 Replies View Related

C++ :: Program That Needs Auto Start At Windows Startup - Adding Registry Entries?

Jan 18, 2012

I am developing a program that needs auto start at windows startup. For that I need to add Registry entries. Also the program needs to read some registry keys. What are the functions i need to do these.. Simply I need to

check if the startup key already exists
add a new key if it doesn't exist
read a key values

View 7 Replies View Related

Visual C++ :: Use CFormView As Main View Without Using Document Support?

Jul 17, 2013

Is it possible to use a CFormView as the main view without using document support. IE pointing CWinApps m_pMainWnd to the CFrameWnd derived MainFrame and attaching the CFormView from there. It does not seem to be working and I was wondering before I waste any more time on the solution if it is even possible. I know it is an easy solution if I create a true SDI application however I have no use for documents in this application.

View 9 Replies View Related

Visual C++ :: FileSet - Cannot Access Variables From Document Class

Jul 31, 2013

I have written a class "FileSet " in program's Document class.

This class contains other Four classes as

"Machine1" , "Machine2", "Machine 3" and "Machine 4".

Now my problem is Machine 1 can not access variables from Document class or other variables from FileSet.

How to access them ?

View 9 Replies View Related

Visual C++ :: Getting Name Of Current Save File?

Oct 10, 2014

When I have loaded a savefile with Serialize, is there some way of telling the name of the currently loaded savefile?

View 2 Replies View Related

Visual C++ :: Outlook MAPI Get Current Profile Name

May 5, 2014

I have a MAPI session that is loged on and valid, I would like to get the current logged on profile string from it.

View 2 Replies View Related

Visual C++ :: Menu Item To Explore Current Path

Feb 21, 2015

I quite often use an ide written in assembler: RadAsm3[URL] .....

It has a menu item to explore current path. I have used other ide's that have a similar feature but:

The one in RadAsm3 will activate a current Explorer window if the current path is the same as the one requested.
All others open a new Explorer window.

I would like to implement the RadAsm3 approach using Visual Studio 2013 Community c++ as my host compiler for testing.

I tried to get the title of current windows but it appears ShellExecute "explore" does not produce a conventional window???

View 1 Replies View Related

C# :: How To Make Screen Splitter

Feb 8, 2015

Screen Splitter will allow main screen to be split into two or more sections. It will be useful for the active program's window to be resized properly to one part of the screen. Using this utility, User will be able to do a split system desktop into two or more areas....

Attached image(s)

View 2 Replies View Related

Visual C++ :: Launching Current Version Of IE To View HTML File From Program

Nov 29, 2012

I tried to do this with _spawnl(), but first of all I'm not sure how to properly ask for the path to iexplore.exe, as I'm sure it will change every time MS gets a whim to move it. I know there's a GetWindowsDirectory() call, but that's not where IE resides (its in "C:Program FilesInternet Exploreriexplore.exe" in XP, Lord know where on win 7 or 8).

Also, even temporarily hard coding the path to make it launch with spawnl(), I can't seem to get my html document to display. I know the path to that is right (since I put it there ).

char * pFile = "someFile.htm";
char * pCmd = "C:Program FilesInternet Exploreriexplore.exe";

int res = _spawnl(_P_NOWAIT, pCmd,pCmd, pFile, NULL); // also tried without specifying pCmd 2x
if (res == -1) MessageBox("Can't Open File.");

So my second question would be, how to you PROPERLY pass the file to view as an argument.

View 7 Replies View Related

Visual C++ :: Unable To Make Addon To IE

Dec 7, 2013

I am trying to make an add-on to IE. This add-on doesn't have any tool bar or any UI.

I am just taking the details of currently loaded HTML page. Basically it is for manipulating one dialog box. I want to get access to the DOM COM interfaces of the dialog box.

Since it doesn't have any button I didn't impliment IOleCommandTarget. I implemented only IObjectWithSIte.

My RGS file contain following in addition to my COM related entries

HKLM
{
NoRemove SOFTWARE
{
NoRemove Microsoft
{

[Code]...

But I couldn't see my add-on working or even not loading to IE.

View 4 Replies View Related

Visual C++ :: Unable To Read LCT File To BMP Image

Nov 20, 2014

I have an *.lct file. I like to read *.lct file and save an bmp image.

I can not read this file using usual file read.

Code:

void CLCTtoBMPDlg::OnBnClickedReadlctfile() {
CFileException CFileEx;
CStdioFile ReadFile;
CString OpenlctfilePath;
TCHAR szFilters[]= _T("LCT Files (*.lct)");
CFileDialog fileDlg(TRUE, _T("bmp"), _T("*.lct"), OFN_FILEMUSTEXIST | OFN_HIDEREADONLY, szFilters);

[Code]...

Find the attachment. change the file extension *.lct instead of *.txt. I like to read ASCII Data into Hex, Example : Data "A" as "41" (Refer the jpeg image). How is possible?

View 4 Replies View Related

Visual C++ :: Unable To Pass Arguments To DLL Function

Nov 17, 2014

I have some trouble with DLL. I created a dll with function

double square(const double * args)

and then in my application defines

typedef double (*MyFunct)(const double *args);

I use LoadLibrary and GetProcAddress to get the function address and cast it to MyFunct. Everything works fine except that when I pass a double *, for example 0x08800350, to the DLL function, the argument becomes totally something else, for example, 0x0aa00460.

I have no clue what happens to the argument value.

View 3 Replies View Related

Visual C++ :: Unable To Display Dialog In UI Thread

Mar 11, 2015

I am having a strange problem trying to display a dialog from a UI thread. The dialog simply fails to display. I have a function DisplayFlashBox(), which creates the UI thread:

CUIThread* CIMUIHelper:: DisplayFlashBox(const CString &sMessage, const int nInstrumentUID) {
CUIThread *pThread = new CUIThread();
pThread->SetString(sMessage);
pThread->SetInstrumentUID(nInstrumentUID);
pThread->CreateThread();

[Code] .....

The dialog doesn't display. When I tried debugging, I found the OnInitDialog() method of CIMFlashBox class doesn't actually return. Very strange. I tried calling the DoModal() method instead of Create, but doesn't display the dialog either.

View 5 Replies View Related

Visual C++ :: Unable To Find Setting For Exception Handling In MFC

Jan 24, 2013

My MDI Project(VC++2010 Professional) is unable to catch errors ,though I return ,try catch block. So I developed simple dialog based application .Placed one button on Dialog and on its click written following code

Collapse | Copy Code
void CMFCExecDlg::OnBnClickedButton1() {
try {
int j = 0;
int i = 10/j;
}
catch(CException * e) {
MessageBox(_T("Hello"),_T(""),MB_OK);
}
}

But still program control does not come in catch block it simply gives error. I tried all child classes of CException but no use.I think there will be some setting in Visual Studio. How to handle exceptions

View 1 Replies View Related

Visual C++ :: Unable To Invoke JScript Functions From Another Thread

May 6, 2013

I have main thread that creates an WebBrowser2 COM object. and i want to invoke JScript functions on it from another thread. i try to use GIT but still doesn't work for me.. there is a problem with marshal WebBrowser2 for JScript?

View 4 Replies View Related

Visual C++ :: Unable To Append Data To CFile Using FILE

Sep 26, 2012

I'm trying to append data to a CFile using FILE* But when execute the application, it always give error saying "No such file or directory". I can actually see the file created but it just keep giving error "No such file or directory".

Is the file being lock or the file just created so it can not be find by fstream(FILE*)? or the file mode is wrong?

Below is the code:

[QUOTE]
void SaveDocument(CString strFile) {
CFile file;
if( !file.Open(strFile, CFile::modeCreate | CFile::modeWrite | CFile::shareDenyNone)) {
CArchive ar(&file, CArchive::store);
// save now.
MyClass.Serialise(ar);

[Code]...

Attached is the printscreen of the FILE* pointer. the pointer is evaluated as bad pointer. Why the FILE* pointer not able point to the file being created?

View 7 Replies View Related

Visual C++ :: Unable To Iterate Over A Vector In Nested For-Loop

Jan 20, 2014

So I have this problem with not being able to iterate over a vector in a nested for-loop. Here's the nested for-loop:

bool innerHit = false;
for (std::vector<Sprite*>::iterator outerIter = sprites.begin(); outerIter != sprites.end() && (!sprites.empty()); outerIter++) {
Sprite* spriteOne = *outerIter;
for (std::vector<Sprite*>::reverse_iterator innerIter = sprites.rbegin(); innerIter != sprites.rend() && (!sprites.empty()); innerIter++) {
Sprite* spriteTwo = *innerIter;

[Code] .....

What happens is, after having called the collisionDestroy-function and the program tries to execute the nest loop in the outer for-loop, it all crashes with the text "Expression: vector iterator not decrementable", which I understand is because the iterator will have already become useless. The question is: know this, how do I fix it? I can't seem to get a hang of it.

Here's the collisionDestroy-function (the collisionReaction does nothing but sets a few local variables):

void Enemy::collisionDestroy(std::vector<Sprite*>& sprites) {
for (std::vector<Sprite*>::iterator iter = sprites.begin(); iter != sprites.end(); iter++) {
Enemy* tmp = dynamic_cast<Enemy*>(*iter);
if (this == tmp && collisionType == 3 || collisionType == 1) {
sprites.erase(iter);
break;
}
}
}

View 14 Replies View Related

Visual C++ :: Unable To Check If Character In 2D Array Is Alpha?

Nov 20, 2012

I am unable to check if the character in the 2D array is alpha

here is my code

#include<iostream>
#include<cctype>
#include<cassert>
#include<cstring>
const int maxChar = 20 ;
using namespace std ;
int main() {
int count = 0 ;
char d[2][20] = { "hi" , "di" } ;

[code]....

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved