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
ADVERTISEMENT
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
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
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
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
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
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
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
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
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
View Related
May 4, 2015
I have code (found long time ago, ~2001) to make videos from OpenGL rendering in my view class. In my OnDraw() function I call the function SaveAsAvi(). This works as intended until I have 255 frames in the movie I am trying to make. After that, Windows Media Player claims it cannot play the file. VirtualDub claims the avi contains Palette Changes and shows the correct number of frames (>255) but all frames past 255 are the same and equal to the last frame.
Memory overflow? Need to free m_pixels sometime somewhere?
Code:
void C***View::SaveAsAvi() {
C***Doc* pDoc = GetDocument();
if (pDoc->m_avi_status == -1)// initialize AVI stuff {
KillTimer(1);
// allocate space for the pixel info
[Code] ....
View 1 Replies
View Related
Nov 5, 2013
I am trying to develop a GUI using MFC, but I am having trouble using CFiledialog to save a file. The problem is, the file is not getting saved to the folder when I use the CFiledialog. Below is the code I am using.
Code:
CString szFilter = "XNRep Files (*.xnrep)|*.xnrep||";
CString s = "xnrep";
CString t = "";
CFileDialog fileDlg(FALSE, s, t, NULL, szFilter);
if(fileDlg.DoModal() == IDOK)
{
std::ofstream file;
[Code]....
After the file dialog opens up, I enter the name of the file and select OK button. But the file does not show up in the directory I am saving to.
View 4 Replies
View Related
May 2, 2013
if there is a way to make Visual Studios step into a function while I am debugging.. I am trying to see the value of a certain int and making sure it is what I need it to be.. but whenever I use step into visual studios just skips right over the function and it does all the calculations..
View 4 Replies
View Related
Oct 22, 2013
I'm developing a software for Windows using MSVC 2010. My employer sent me 2 png files: 16x16 and 32x32 for the icons.
What I would like to do is to use them as a MSVC icon resource and don't use any code hacks. In the past all I had was an ico file and I just included it in the resource (rc) file for Visual Studio and that was it.
Now my question is: how do I make one ico file out of those 2 png files that will be accepted by MSVC? Is there a tool (preferably free) for it or some online service?
View 3 Replies
View Related
Feb 17, 2013
Here is my code for a simple game. paste it and try it.
#include <iostream>
#include <string>
#include <ctime>
#include <cstdlib>
using namespace std;
int main (void) {
stringg[4],
[code]...
What they do (enter 4 actions)?
";
for (int ai = 0; ai < 4; ai++)
getline(cin, a[ai]);
cout << "
Where is happening (enter 4 locations)?
";
for (int li = 0; li < 4; li++)
getline(cin, l[li]);
for (int c = 0; c < 4; c++)
cout << g[rand() % 4] << " and " << b[rand() % 4] << " are " << a[rand() % 4] << " from a " << l[rand() % 4] << endl;
return (0);
}
At the end in the 4 lines some of the names, actions and locations repeat. How do I make them to not repeat and use every name that you will enter? do I need random_shuffle? How can I integrate it in my code?
View 1 Replies
View Related
Sep 9, 2014
I know how to define a shape (here, a rectangle) and attach it to a window in C++ as follows:
Code:
#include <Simple_window.h>
void cir() { Circle c(Point(100,100),50); }
int main() {
Simple_window win(Point(100,100),600,400, "test");
[Code] ....
But how to define a shape (say a circle by that cir() function which is) outside of the main() function that is how to create a circle inside of the cir() function and it returns that circle when I called it in my main() function so that I can attach it on the window win to be visible?
View 14 Replies
View Related
Apr 30, 2014
I have to make a maze with arrays, but i cant seem to move down or up or at all. Here is what I have so far
#include <iostream>
#include <string>
#include <iomanip>
#include <fstream>
[Code].....
View 5 Replies
View Related
Nov 4, 2013
I'm working on a project which uses gtk+ and gtkmm. We use them in preference to MFC because the program needs to be cross-platform. For quite a long time, customers on OS-X and Linux have sometimes complained that the program would crash during shutdown but the Windows version (which I work on) never seemed to suffer. However, I'm now transferring my build environment to a new PC and I'm noticing the same shutdown crashes. It's a bit complicated so let me start with a small example:-
Code:
namespace Whatever {
class B {
public:
virtual ~B();
private:
int bb;
[Code] ....
Suppose I run the above program. When it stops at breakpoint #1 I make a note of the value of pA. Eventually the program reaches breakpoints #2 and #3. At each point my this pointer is exactly the same number. If the value of pA was 0x03604fb0, my this pointer is identical at both stages.
Now let's consider the real example:-
Code:
namespace Gtk {
class Widget {
public:
virtual ~Widget() {}
[Code] .....
Suppose I run the real example. At breakpoint #1 the value of pW is 0x03604fb0. But by the time I reach breakpoint #2 my this point is slightly different:- 0x03604fcc. It doesn't seem right to me and I'm wondering if it might be contributing to our shutdown crashes.
View 6 Replies
View Related
Mar 27, 2014
I want make connection between access 2013 and visual studio 2010(c#) but the error below is displaying
View 7 Replies
View Related
Sep 19, 2012
I'm trying to remake my Windows screensaver written with C++ and WinAPIs to work on multiple monitors. I found this article that gives the basics. But when I implement it in my own code, I get a weird result. Take a look at this code:
Code:
case WM_PAINT: {
PAINTSTRUCT ps = {0};
HDC hdcE = BeginPaint(hWnd, &ps );
EnumDisplayMonitors(hdcE, NULL, MyPaintEnumProc, 0);
EndPaint(hWnd, &ps);
[code]....
Painting always works on a primary monitor. But when I paint to the secondary monitor, I can only paint directly to its DC. When I use double-buffering technique (with DIRECT_PAINT pre-processor directive commented out) I only get a black screen on a secondary monitor when it should've been red.
First one with direct painting that works:
and then the one that doesn't, with double-buffering technique:
View 12 Replies
View Related
Aug 10, 2014
This code compiles in release mode but I get this compile error in debug mode:
Error1error C2664: 'GetPrivateProfileStringA' : cannot convert parameter 4 from 'wchar_t [255]' to 'LPSTR'g:easywebstoreuploaderini.cpp45
Code:
CString CIniFile::getKeyValue(CString strKey, CString strSection) {
wchar_t ac_Result[255];
// Get the info from the .ini file
m_lRetValue = GetPrivateProfileString(strSection, strKey, _T(""), ac_Result, 255, m_strFileName);
CString strResult(ac_Result);
return strResult;
}
View 3 Replies
View Related
Nov 10, 2012
My assignment is to create a C++ Program to find the sine of a number without any library other than iostream by using Taylor Series:
sin (x) = (x/1!) - (x^3/3!) + (x^5/5!) - (x^7/7!) + (x^9/9!) ...... (x^n/n!).
Here is what i have done till now:
#include <iostream>
double fact (int f); //declaration of factorial function
double power(double x, int y); //declaration of power function
double sin(int x); //declaration of sine function
//double cos(int x); //declaration of cosine function
//double tan(int x); //declaration of tangent function
[code]....
View 3 Replies
View Related
May 25, 2014
I had been tasked to create a program that reverses a word i.e.
cat
tac
How to make my program non case-sensitive using vectors?
Code:
// BackWardsSentence.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
string BackWords (string sentence);
int BackSentence (string sentence);
string BackWords1 (string sentence);
[Code] .....
View 2 Replies
View Related
Nov 30, 2013
my a book or website where I can make a transition from console programming to GUI programming. I'm totally confused about this. I know how to program in console and can make a whole program based on console. I also know the OPP programming, but it's clear that nobody uses console programming anymore.
View 10 Replies
View Related
May 5, 2013
Code:
#include <stdio.h>
char * strcpy(char *restrict s1, const char *restrict s2);
struct item {
char title[20];
struct item *next;
} firstCard;
int main (){
strcpy(firstCard.next->title, "whatever");
}
I am unable to set firstCard.next->title
View 2 Replies
View Related
Sep 4, 2014
Whats wrong with my code, I wasn't able to input for Lastname field.
#include <iostream.h>
#include <windows.h>
HANDLE console = GetStdHandle(STD_OUTPUT_HANDLE); // For gotoXY() function
COORD CursorPosition;
[Code]....
View 1 Replies
View Related