C++ :: Hook HW Interrupts In Flat Memory Mode With DOS32/A

Jul 23, 2012

I have a question about how to hook HW interrupt in flat memory mode...

@ about my application...
- application is created by combining Watcom C and DOS32/A.
- application is written for running on DOS mode( not on OS mode )
- with DOS32/A now I can access >1M memory and allocate large memory to use...(running in flat memory mode !!!)

@ current issue...
- I want to write an ISR(interrupt service routine) for one PCI card. Thus I need to "hook" the HW interrupt.
- Ex. the PCI card's interrupt line = 0xE in DOS. That means this device will issue interrupt via 8259's IRQ 14.

But I did not how to achieve my goal to hook this interrupt in flat mode ?

@ resource I found...
- in watcom C's library, there is one sample using _dos_getvect, _dos_setvect, and _chain_intr to hook INT 0x1C...
I tested this code and found OK. But when I apply it to my case: INT76 ( where IRQ 14 is "INT 0x76" <- (14-8) + 0x70 )
then nothing happened...
* I checked HW interrupt is generated but my own ISR did not invoked...

Do I lose something ? or are there any functions I can use to achieve my goal ?

View 2 Replies


ADVERTISEMENT

C++ :: How To Skip A Block Of Commands When User Interrupts

Nov 3, 2014

I am working on a program that does something like this,

Void main() {
cout<<"H";timedelay(1);
cout<<"E";timedelay(1);
cout<<"L";timedelay(1);
cout<<"L";timedelay(1);
cout<<"O";timedelay(1); //timedelay(int a) is a function which gives a delay of 'a' seconds.
{
....
}
}

This code is just for fancy and I would like to squish in some statements which would give the user an option to skip it (by entering any keyboard key),and resume with the rest of the program.

View 10 Replies View Related

C# :: Flat Style Dropdown Menu Not Drawing Correctly In XP

Apr 23, 2014

I'm having issues with drawing a flat style dropdown menu in XP.

Here is the custom dropdown menu element:

public class FlattenCombo : ComboBox {
private Brush BorderBrush = new SolidBrush(SystemColors.WindowFrame);
private Brush ArrowBrush = new SolidBrush(SystemColors.ControlText);
private Brush DropButtonBrush = new SolidBrush(SystemColors.Control);
public Color HighlightColor { get; set; }

[Code] ....

Here is what it looks like in XP:

And here's what it should look like (this is how it's rendered in Windows Vista/7):

View 3 Replies View Related

Visual C++ :: Calculating Shipping Charges - Amount Always Comes Up As Flat Rate Variable

May 14, 2015

I'm currently working on a program that calculates shipping charges. However I'm stuck, whenever I compile the program the total amount at the end always comes up as my flat rate variable and not the total calculated number.

Code:
#include <iostream>
#include <iomanip>
#define FLAT_FEE 5
using namespace std;
int main() {
double num, pound, ship;
ship = FLAT_FEE;

[Code] ....

View 6 Replies View Related

C# :: External Window Paint / Draw Hook?

Jan 13, 2014

Is there any way that I can call a function/receive an event whenever an external window (not any of my forms) repaints/draws?

If you create a GDI+ graphics object and give it the HWND of another window that refreshes a lot like a web browser, anything with animated graphics, your draws and the windows draws are out of sync which creates an intense flicker effect.

Googling this issue only brings up results for handling when my own form repaints...

My idea is that I could just redraw my GDI stuff whenever the form redraws, this is indeed possible?

View 9 Replies View Related

Visual C++ :: How To Start Process Without Loading Global Hook

Apr 21, 2014

I had created a global hook by SetWindowsHookEx with WH_CALLWNDPROC. It is used to create a new toolbar button in specific window in the specific (3rd party) program (named HOOKEE.exe for example), and it works perfectly fine most of the time. Normally HOOKEE.exe is launched by double clicking the shortcut icon on desktop. But this program could be also launched in another way (provided by the provider of HOOKEE.exe), with this new way, HOOKEE.exe is by conhost.exe (on Windows 7), and then I could see (via ProcessMonitor) my hook is loaded by conhost.exe, but not the process HOOKEE.exe. In my understanding global hook would be loaded by whatever process, I have no idea on the exception, and what conhost.exe does to the HOOKEE.exe.

View 13 Replies View Related

C/C++ :: How To Hook Function From Same Process And Get Address Of Caller Function

Apr 27, 2013

I need to do it to avoid calling a function of my process from injected code.

So would like to hook this function to check whether the call is from the current module or it is from an external module, then I compare the address of the instruction who did the call with the module address range.

View 1 Replies View Related

C++ :: Mode In 2-D Array

May 2, 2014

I have to find mean,mode and median of a 2-D array :

2 5 2 5 9 5 8 3 6 10
8 1 10 10 7 1 4 4 3 8
4 3 1 2 4 10 3 9 8 5
6 10 8 3 6 10 5 1 2 5
2 2 9 2 5 5 1 1 7 5
7 9 9 2 1 5 2 2 2 4
3 6 1 9 3 4 10 7 4 6
7 10 4 6 2 10 10 8 7 6
7 1 3 6 2 4 6 7 8 9
8 5 9 2 3 2 1 5 1 8

I coded for mean but stuck for mode.

Code:
// Assign4_Q2.cpp : Defines the entry point for the console application.//

#include "stdafx.h"
#include<iostream>
#include<iomanip>
#include<conio.h>
using namespace std;

[Code] ......

View 10 Replies View Related

C# :: How To Get Monitor Out Of Sleep Mode

Jul 12, 2012

How can you get a monitor out of sleep mode in c#?

I tried the following, but then the monitor wakes up and falls back to sleep mode immediately.

Code:

uint SC_MONITORPOWER = 0xF170;
uint WM_SYSCOMMAND = 0x0112;
SendMessage(this.Handle, WM_SYSCOMMAND,
(IntPtr)SC_MONITORPOWER, (IntPtr)(-1));

View 1 Replies View Related

C :: Finding Mode Of Array

Mar 20, 2014

I've been trying for over an hour to think of the logic to find the mode of an array.I left out code for initializing the arrays, but all the values in the array are between 0-9. Check out my code below.

Code:

int mode( int array[], int size ) {
int i;
int count;
int max = 0;
int num = 0;
int mode;

[code]....

View 7 Replies View Related

C++ :: How To Find Mode In Array

Feb 6, 2014

How do you find a mode in array? This is what i got so far. I put this after i sort the array

for (int index = 0; index < size2; index ++) {
//count[mode[index] - 1]++;
if (mode[index] == mode[index + 1]) // compare the first to sec array {
again++;
cout <<"This is number " << again << endl;
}
}

View 1 Replies View Related

C++ :: Find Mode Of Vector Through Map?

Feb 16, 2015

Im currently trying to find the mode of a vector through a map but am not sure how to do so besides the attempt ive made

void mode(vector<double>v)
{
map<double, int> map;

[Code]....

View 3 Replies View Related

C/C++ :: Mode Of Sorted Array?

Sep 14, 2014

I've been working to make program to find the mode of sorted array. But the program didn't return the results correctly. Here is the code:

#include <iostream>
using namespace std;
int main () {
cout<<"Enter the size"<<endl;
int size;
cin>>size;
int data [size];

[code]....

View 14 Replies View Related

C++ :: Compute Mean / Median / Mode For Map Construct

May 28, 2013

I am writing code, which reads an input file (280 MB) containing a list of words. I would like to compute

1) total # of words
2) total # of unique/distinct words
3) mean/median/mode of word count (Link)

I managed to get done with 1) and 2), but my program crashes for 3). I am not quite sure whether there are memory issues or some bug in the code.

Code:
#include <iostream>
#include <fstream>
#include <string>
#include <map>
using namespace std;

[Code] .....

View 2 Replies View Related

C++ :: Finding Mode Of Numbers In Array

Sep 9, 2013

I have to use numbers in my .txt file that are stored in an array. So i have to write a function to find the mode of the numbers in my array.

View 5 Replies View Related

C++ :: How To Get The Current Video Mode In Console

Apr 2, 2014

I've been wondering if there's a function or procedure used to know the current video mode. An example of how this was done in Pascal:

function VideoMode : integer;
begin
if (lastmode = BW40) or (lastmode = BW80)
VideoMode := 40
else
VideoMode := 80;
end;

I've been told "conio.h" has a lastmode function, but it doesn't seem to be supported in Dev-C++ and Visual Studio C++. Is there a Windows function to know the number of columns in the current video mode?

View 1 Replies View Related

C/C++ :: Using Function To Find Mode Of Array?

Oct 20, 2014

My code seems to find the mode of the array I input sometimes. Sometimes it gives me the wrong number or multiple numbers. It just all depends on what is number is inputted into the array. I don't know what the problem is. I tried looking online and editing many times and can't find the answer. Maybe I'm overlooking something or doing something wrong. Here's my code.

#include <stdio.h>
void readArray(int arr[], int length)
{
printf("Enter data:
");

[Code].....

Maximum: 15
Mode: 2

As you can see the mode is clearly not 2 and I do not know why.

View 8 Replies View Related

C/C++ :: Find Mode Of Sorted Array

Sep 14, 2014

I've been working on my program to find mode of sorted array. But the program didn't return the res

#include <iostream>
using namespace std;
int main () {
cout<<"Enter the size"<<endl;
int size;
cin>>size;
int data [size];

[Code] ....

View 1 Replies View Related

C++ :: Calculate Mode / Mean And Median Of Array Of Integers

Mar 17, 2013

I'm writing a program that calculates the mode, mean and median of an array of integers. I've done the mean and median but i can't figure out mode.

I have to find the number of modes.

Ex array of integers: 10, 10, 4, 5, 6,5, 6, 7

My function has to return the number 3. Because there are 3 sets of mode; 10,5,6.

How do i implement this in my function because for now it just calculates the mode. It only return the number mode 10.

View 5 Replies View Related

C++ :: Vector Iterators Incompatible In Debug Mode

Jul 11, 2013

I get this error when i try to run this code for an inventory in debug mode in VS. But for some reason it works just fine in release mode.

void Push_Back_Item(Item *item){
for(int y = 0; y < InvSizeY; y ++)
for(int x = 0; x < InvSizeX; x ++){
auto Iter = ItemList.find(std::make_pair(x,y));
if(Iter != ItemList.end()){
item->SetDead(); // ERROR
}
}
}

This isnt the full code though but it still gives me the same error.

The only thing "item->SetDead()" does is to set a bool to true.

This is the map i get the iterator from
std::map<std::pair<int,int>,Item*> ItemList;

This have been bugging me for quite some time now.

View 4 Replies View Related

C++ :: Finding X / Y Pixel Address In Mode 13h VRAM?

Jul 21, 2013

I'm currently working with linear VRAM (a buffer with 256KB memory, divided into four 64k planes, so plane 0 at 0x00000, plane 1 at 0x10000, plane 2 at 0x20000, plane 3 at 0x30000). Just add the index of the plane to that for the full address in VRAM.

I'm still wondering how to get a specific pixel from VRAM (x,y coordinate) when doing graphic modes (none color modes work, only the black/white pixels (1-bit) graphic mode works).

how I can get specific pixels from the VGA VRAM (having linear access described above) using Shift Register Interleave mode (VGA modes 4&5), 16-bit planar mode (Most VGA modes) etc.

View 4 Replies View Related

C++ :: Program Works In Release Mode Not In Debug?

Feb 20, 2013

i've got an assigment that requires me to overload some operators and add some objects together.

I will show the code and explain as good as I can.

void SArray::operator+= (const SArray &obj)
{
Sphere * tmp_arr;
tmp_arr = new Sphere[obj.antalobjekt+this->antalobjekt]; //antalobjekt = //Gets amount of elements in the arrays.

[Code]......

m_arr is the inner array for storing elements, do ask if something is not clear enough. The copy constructor works, so i have not included it.

View 1 Replies View Related

C++ :: How To Make Colorful Text In Graphics Mode

Sep 14, 2013

I needed to know if there is any possible way to make a colorful text in graphics mode

Like each letter will have different colors using setcolor(random(20));

View 1 Replies View Related

C/C++ :: Find Minimum - Getting Median And Mode In Array

Feb 7, 2015

So I am trying to find the min, max, range, mean, median, and mode. The max number is right but the min isnt. Once that is corrected, i can get range and mean easily. Also, how to get mode and median. I am guessing the values in the arr2 would have to be sorted. This refers to the values in arr2 which are the calculated values in the formula. You can enter -2 and 2 for userMin and userMax.

#include <iostream>
#include <iomanip>
using namespace std;
int main() {
cout << fixed << setprecision(1);
float userMin;

[Code] .....

View 13 Replies View Related

C# :: Creating Controls Which Act Differently Depending On Mode

Apr 24, 2014

I am creating a C# windows application which allows it to connect to our devices and communicate with them.

Often we need to customise this application and I have made this easier by defining its appearance and actions within an XML file which gets read in every time the application starts up. This is working really well.

However editing this XML file can be pretty laborious and often requires many cycles to get everything correct again. So I have started to create a graphical editor which allows for the XML to be generated.

The problem I am facing is that I am using the same controls in the final program and the editor so my question is how should I structure the code so that each control knows when it is in "Normal" mode and when it is in "Edit" mode?

I have started using a simple boolean flag to indicate its mode, however this now means that within every function I need to check this flag and run code appropriate to that mode, this seems a bit over the top. Is there a better/standard way this sort of this is done?

View 1 Replies View Related

C/C++ :: Error For Loop Initial Declaration Used Outside C99 Mode

Nov 13, 2013

I have this error while compiling the program.

Below is the code :

#include<stdio.h>
#include<stdlib.h>    
int main() {
    char* A = 0;
    char* tmp = 0;

[Code] ....

View 2 Replies View Related







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