Visual C++ :: Implementing Parameter Argument To Exe
Nov 5, 2013
i have this Stealth Injector source from internet so this program is for injecting .dll to an .exe this program was made by someone to used for cheating in online game but i need to use this program in my private server game online to tell the game client .exe the server IP, that is stored in a dll file.. the problem is i don't want the player to directly execute this program, but they need to run the game patcher first to do the patch.. so i need to put some secret parameter argument that will block player from direct execute..
i know nothing about c++ i only know that you need to use main(int argc, char *argv[]) i've try to put something like this
Code:
int main(int argc, char* argv[]){
stringstream sparam;
string param;
[Code].....
the code works fine but the rest of code won't executed..
i've attached the cpp and header files for you guys to check source.rar
View 3 Replies
ADVERTISEMENT
Nov 24, 2014
I am writing a text-based rpg and I'm having some issues trying to pass the player struct to a function. First, here are the relevant code snippets. Also, Player.c and Player.h aren't completed but the relevant function is. I just run tests every now and then to see if everything is working right.
Monster.h
#ifndef MONSTER_H
#define MONSTER_H
#include "Weapon.h"
typedef struct Player;
typedef struct {
char* mName;
[Code] ....
The errors are:
1. line 33 in Monster.h, the void Attack_Monster_Types(Monster* m, Player* p) the ide says missing ')' before '*', missing '{' before '*' and 'Player' name in formal parameter list illegal
2. line 18 in main.c when the attack function is called. it says 'Attack_Monster_Types' Undefined; assuming extern returning int.
I believe I have all the right headers included so I'm not sure what to do ....
View 13 Replies
View Related
May 26, 2014
difference between an argument and parameter...understanding the difference between these two.
View 2 Replies
View Related
Dec 1, 2014
I faced a compilation error in the following code :
Code:
#include <iostream>
using namespace std;
void addition(int a, int b = 2, int c);
int main()
[Code]......
My question is that when i have called addition() with the 3rd argument, then what is the necessity of having the default argument for the 3rd parameter ?
View 6 Replies
View Related
Jan 17, 2014
I was having problems changing the value of my head node I passed it as an argument as head which would be the address. The parameter was defined as struct node *head. like this
bool deleteNode(struct node *head, struct node *delptr)
I tried manipultaing pointer values to change head node value but it did not work. I saw some code online which used pointer to pointers(in code below) to change head node value it worked I dont fully understand why. Would like better understanding of why.
Would also like to know why the argument call needed &head instead of just head.
remove = deleteNode(&head,found); opposed to remove = deleteNode(head,found);
#include "stdafx.h"
#include<iostream>
struct node{
[Code].....
View 1 Replies
View Related
Mar 21, 2013
We're designing a new software and we want it to be customizable without code. That, for us, mean we can change the software behaviour without re-writing code. All will be developed using C and .NET.
One of our goals is to have what we are calling "dynamic tables". This means that these database tables may have different fields depending on the customization. We got to know it using high-level ERPs like SAP or CRM's system like VTIGER or even SalesForce. Let me give an example:
CUSTOMER TABLE:
FIELDS: ID, NAME, ADDRESS, PHONE.
This would be the standard Customer Table.
Now, a new customer needs to add FINANCE SCORE and RANKING to the database. We them would like to go to our application (not the database itself) and adding these new fields. After that, all of my input forms and reports would start to show and process these new fields.
View 4 Replies
View Related
Nov 30, 2012
I'm am having a few issues with this program, they stem from passing the color.h and .cpp into another .h and .cpp, and frankly getting how those two things really fit together.
For this problem, you will design and implement 2 classes and then write a driver function to test these classes. The first will be a C++ class for an abstract data type color with a public enumeration type colorType that has the color values shown in Listing 10.8. Your abstract data type should have an attribute for storing a single value of type colortype and member functions for reading (readColor) and writing (writeColor) a color value as well as setting and accessing it. The function readColor should read a color as a string and store the corresponding color value in the value attribute of a type color object. The function writeColor should display as a string the value stored in the value attribute of a type color object (see Figure 7.5). Modify class circle and the driver function in Listing 10.9 to include and use this class. You'll need to remove the declaration for color in class circle. Test your modified driver function with the new color and circle classes.
The second class will be to design and implement a rectangle class similar to class circle. Be sure to incorporate the new color class you have written and tested in the first part of the programming exercise. Write a client program that asks the user to enter a shape name (circle or rectangle) and then asks the user for the necessary data for an object of that class. The program should create the object and display all its attributes.
The circle class .h and .cpp files as well as the original driver function will be supplied. You are to provide the .h and .cpp files for the new color class and the modified driver function as well as the .h and .cpp files for the rectangle class and the client program that uses all three classes.
color.h
Code:
//color.h
//Color class definition
#include "stdafx.h"
#ifndef COLOR_H
[Code].....
View 3 Replies
View Related
Nov 15, 2013
I was assigned a project to implement a real time graph to an application which continuously outputs data numerically through the GUI. The application that was created to do this is written in C.
I have to turn those numerical numbers into a graphical display that is periodically updated to appear as real time.
My adviser suggested using NTgraph [URL] ...... I had no clue how to implement this to my code and was finally able to understand that the .OCX needs to be registered as a COM and then imported to the application using visual studios. However, I get an error when I try importing it since it is in C (Visual Studios 8) and not an MFC application.
So my question is if it would be possible to implement the ActiveX control to my application even though it is not an MFC application and how to go about it.
View 6 Replies
View Related
Feb 21, 2014
Below is my Code Code snippet wher I am facing problem.
every time "pNMHDR->idFrom" is returning 0.
I even put "EnableToolTips(TRUE);" in the oninitdialog method of dialog class.
BEGIN_MESSAGE_MAP(CMyListCtrl, ListCtrl)
.
.
.
ON_NOTIFY_EX(TTN_NEEDTEXTW, 0, OnToolTipText)
ON_NOTIFY_EX(TTN_NEEDTEXTA, 0, OnToolTipText)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
[Code] .....
I am not able to get the text of a listctrl cell.
View 3 Replies
View Related
Nov 18, 2013
I am unable to implement the insert function properly,every time i run the program i just get the first value and name,i am not getting other Id's and name.
Code:
"(Header File)"
#include <iostream>
#include <string>
using namespace std;
class node {
public:
int ID;
node (string StudentName, int IDNumber) {
[Code] ....
View 4 Replies
View Related
Feb 24, 2015
How to check the type of argument passed to each function, checktype, in below?.
void checktype(void *p)
{
}
or
template <typename Type>
Type checktype(Type t) {
}
View 3 Replies
View Related
Feb 7, 2013
The code below outputs this:
a[]= 00
a[]= 10
a[]= 10
a[]= 10
a[]= 11
a[]= 11
0.
But I was expecting this:
a[]= 00
a[]= 10
a[]= 10
a[]= 00
a[]= 01
0.
This describes how the process is running in machine:
1. Defining a[2]{0,0}; ii=0; aj=0
2. Calling function func(a,ii,aj) |func({0,0},0,0)|
3. func({0,0},0,0) defining w=0; static aa=0
4. func({0,0},0,0) if(0) returns aa=1
5. func({0,0},0,0) for j=0
6. func({0,0},0,0) for Outputing "00", because a[2]={0,0}, look (1).
7. func({0,0},0,0) for if(!0) | because a[0]=0| returns w+=func(a,ii+1,j) |func({0,0},0+1,0)| and calls func({0,0},1,0)
8. func({0,0},0,0) for if func({0,0},1,0) defining w=0
9. func({0,0},0,0) for if func({1,0},1,0) if(1) returns a[0]=1, because of static aa=1, см 4.
10. func({0,0},0,0) for if func({1,0},1,0) for j=0
11. func({0,0},0,0) for if func({1,0},1,0) for Outputing "10", because of a[2]={1,0}, look row #9
12. func({0,0},0,0) for if func({1,0},1,0) for if(!1) |because a[0]=1|
13. func({0,0},0,0) for if func({1,0},1,0) for j=1
14. func({0,0},0,0) for if func({1,0},1,0) for Outputing "10"
15. func({0,0},0,0) for if func({1,0},1,0) for if(!0) |because a[1]=0|
16. func({0,0},0,0) for if func({1,0},1,0) for if if(1==1) |because ii=1, func({0,0},ii,0)|
17. func({0,0},0,0) for if func({1,0},1,0) for if if return 0
18. func({0,0},0,0) for if w=0 |because func({1,0},1,0) gives 0|
19. func({0,0},0,0) for j=1
And from now, something is happening that I cannot understand:
20. func({0,0},0,0) for Outputing "10"
Why so? If func has itselfs local variables, including a[2]={0,0}.
I was expecting this:
20. func({0,0},0,0) for Outputing "00"
So a[2] array is not local variable. Why it happens?
Code:
#include <iostream>
using namespace std;
int func(bool a[],int ii,int aj) {
int w=0;
static bool aa=0;
[Code] ....
View 3 Replies
View Related
Apr 29, 2014
I have a very strange problem with the system() function (on XP).
I have the following code:
Code:
char *text1 = ""A SpaceAction.bat" fred";
char *text2 = ""A SpaceAction.bat" "fred"";
int main(int argc, char *argv[]) {
printf("%s
", text1);
[Code] .....
When I run it where "A Space" is a directory with a space in the name, this is the result:
Code:
"A SpaceAction.bat" fred
F:Test>echo Testing
Testing
"A SpaceAction.bat" "fred"
'A' is not recognized as an internal or external command, operable program or batch file.
It seems that the double quotes round an argument make the parsing of the command fail.
View 1 Replies
View Related
Apr 2, 2015
Is there an "easy" way to define a template with a template parameter that could resolve to "nothing".
Code:
template <typename T1, typename T2, typename T3>
struct one_to_three {
public:
T1 t1;
T2 t2;
T3 t3;
};
Now I want to be able to instantiate that in such a way that T3 and T2 (if T3 also) resolve to "nothing".
Don't point me at tuple<>, this has to be a single structure. No dummy's, nothing effectively means nothing.
so on Win32
Code:
one_to_three <int, int, int> x;
sizeof(x) == 12;
one_to_three <int, nothing, nothing> y; // whatever 'nothing' needs to be.
sizeof(y) == 4;
T1 will never be 'nothing'
T2 will only be 'nothing' if T3 also is 'nothing' (if it works with T3 not being nothing, that's fine, but it won't get used that way).
Portability is a non-issue, this only needs to work in VS (2010 and higher). The 'real' solution will need up to T10, I have a solution working with SFINAE, but it takes very very long to compile and it's getting very unwieldy if you would need to add T11.
I know it's not an ideal type approach, but it is what it is, this is a necessity due to linking with a legacy API which we don't have control over.
View 9 Replies
View Related
Feb 12, 2014
I need to pass a variable to a dialog box.
Code:
Doc* pDoc;
Dialog dlg;
int input = dlg.DoModal();
When I call dlg.DoModal() I need to somehow pass the pDoc into the dialog box. Everything I need the variable for is taking place inside the oninitdialog function. Is there anyway to pass the variable to that function?
View 2 Replies
View Related
Sep 11, 2014
So I'm currently using Visual Studio 2013, and I was left for homework as a beginner programmer to calculate two summations. First the summation of k to n. k=1 and the equation being k^3. The parameter would be n and I need to printf the results for n=5, 33, 100, 442, 3456.
I know that some of the numbers are big values so float or long should be used but how to define these as of yet.
Another is to find the summation
(n)
(k) <<-- one big paranthesis
for values k=8 and n=10, 21, 35, 46, 68
How to start excluding <stdio.h> and int main ... Also, do I have to repeat a new function for every number for n?!
This is what I have so far for something I did differently
// Factoriales Sumatorias
#include <stdio.h>
int suma1 {
int n = 5; // Defino e Inicializo la variable
long sumatoria = 1; // definicion e inicializacion del resultado
while (n <= 5)
[Code] .....
View 3 Replies
View Related
Nov 25, 2014
I'm having some issues with my code. For the produce function i am getting an error saying 'no instance of overload function produce() matches the argument list' and also for the lines buffer[head].data = message; buffer[head].time = current_time i get an error saying 'expression must have pointer to object type.
In the code i'm not sure if i passed the variables to the function correctly. I have attached the code .....
code produce.txt
View 14 Replies
View Related
Jul 24, 2014
[URL]
class CMyclass
{
public:
CMyClass(BOOL bUseWhichMemManager);
void* operator new(size_t);
void operator delete(void*);
};
I create two memory manager called CMemManager1 and CMemMangaer2, using different algorithms to allocate buffer. Now I want to control which memory manager to be used, when calling new.
I try to add a parameter bUseWhichMemManager to the constructor, but in overrided new function, there are no way to access the parameter. Is there a way to pass more parameters to new operator, such as:
void* operator new(size_t size, BOOL bUseWhichManager);
View 1 Replies
View Related
Jan 13, 2014
I have a Windows service that may change the timeout of the logon screensaver in Windows (as described here.) To do that I change the following registry key to the timeout in seconds:
Code:
HKEY_USERS.DEFAULTControl PanelDesktopScreenSaveTimeOut
The issue is that how do I make OS "read" or refresh the actual screensaver timeout after a change in the registry key above?
My practice shows that it is refreshed (for sure) only when I reboot the system, but in my case I need it to be applied without the reboot.
View 14 Replies
View Related
Nov 25, 2012
i need to write a function with an array parameter and an int parameter.
that array has to be filled with first 10 prime numbers that are exact or higher than the int parameter...and then i need an average value of those 10 prime numbers...
The problem is im not really sure how i should do the part to fill the array with prime numbers that are higher than that int??
Code:
int avgprimearray (int higharray[], int somenumber){
}
View 1 Replies
View Related
Sep 28, 2014
My errors are at the end of the program in two function calls within the definition of the InsertByValue function. g++ does not seem to recognize NumArray as a valid parameter.
#include <iostream>
#include <assert.h>
using namespace std;
const int CAPACITY = 20;
/* Displays the content of an int array, both the array and the size of array will be passed as parameters to the function
@param array: gives the array to be displayed
@param array_size: gives the number of elements in the array */
void DisplayArray (int array[], int array_size);
[Code] ....
View 1 Replies
View Related
Apr 1, 2013
Can local variable be passed as the parameter for a new created thread procedure? Here is the example code:
Code:
void CDLG::some_function()
{
CString strFileName="abc.doc";
//local variable, can it be valid for being passed into the following new thread???
//Can strFileName still be accessed from within the stack of thread procedure?
::AfxBeginThread(ProcessContentThread,(LPVOID)&strFileName);
}
[Code]...
There is another method using variable on the heap,
Code:
void CDLG::some_function()
{
CString strFileName="abc.doc";
CString* pstrFN=new CString(strFileName);
::AfxBeginThread(ProcessContentThread,(LPVOID)pstrFN);
}
[Code]...
I test these code, both methods work as expected, but I doubt whether the first method is a good way. OR if only the second method is the correct way to pass a parameter to a thread.
View 12 Replies
View Related
Sep 8, 2014
I am new to VC++ 2012. I have this code snippet.
Code:
auto it = query_map.find(U("callback"));
The problem is right under the dot there is a red line the error is
Error1error C2664: 'std::_Tree_iterator<_Mytree> std::_Tree<_Traits>::find(const http::uri::encoded_string &)' : cannot convert parameter 1 from 'const wchar_t [9]' to 'const http::uri::encoded_string &'d:maverickprojectsstrikeforcesrcserverserverserver.cpp26
What is the solution to this error?
View 3 Replies
View Related
Dec 4, 2013
I am developing new project in Qt with existing MFC project . SO in MFC I have a function which uses SYSTEMTime and return CString.
example
CString getTimestampString( void )
{
SYSTEMTIME systemTime;
CString datestr;
[Code]....
PS -> I cant able to make any changes in lib_know as this library is being used by many other projects..
View 1 Replies
View Related
Jul 2, 2013
Here's my function definition
bool validateNumber(string& text, int min = 0, int max = -1, bool useMin = true,
bool getValid = true)
The code takes the string text, and checks the make sure that the input is valid and safe to convert and use as a number. However, sometimes there is not min, and sometimes there is no max. The lack of min is done by using the parameter useMin, while the lack of max is done by max < min.
My predicament is the following call:
validateNumber(text, -2);
Now, max will be used, even though I don't want it. Ideally, I would want to do something like... int max = (min - 1), ... but that doesn't work. I also can't check to see if the parameter hasn't been changed (that I know of), because the following call would make it look like it hasn't
validateNumber(text, -2, -1);
So the question is, is there a way to do what I want, without having to add in a bool useMax parameter? Or is this my only option? I don't want to do that for simplicity, but if I have to, I have to.
View 3 Replies
View Related
Mar 19, 2013
I searched the web for error: C3867... and the discussions where murky or obscure.
My code excerpt is:
#pragma once
#include <windows.h>
#include <stdlib.h>
#include <process.h>
void PutUpfrmIO(void *);
namespace WordParsor {
[Code] .....
I get the generic message:
error C3867: 'WordParsor::Form1::PutUpfrmIO': function call missing argument list; use '&WordParsor::Form1::PutUpfrmIO' to create a pointer to memberc:userskingc++wordparsorwordparsorForm1.h... and the suggestion fix generate another error.
One person suggested the gcroot<> object wrapper... but I do not know how to modify/declair the function or its argument type.
View 2 Replies
View Related