Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > C++ Builder
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 06-01-2005
carlosmoralesm carlosmoralesm is offline
Miembro
 
Registrado: feb 2004
Posts: 94
Poder: 21
carlosmoralesm Va por buen camino
Unhappy hacer que un exe reciba parametros externos

como puedo hacer que un exe reciba parametros externos
esto es que cuando lo llamo me pide escribir el parametro
pero quiero que funcione de la siguiente forma

myprogram.exe /1 /4,017,16

o

myprogram.exe -1 -4,017,16

esto es para pasarle directo los parametros y no utilizar el
comando scanf

#include <time.h>
#include <stdio.h>
#include <string.h>
#include <windows.h>
#include "MyBlasterUtil.h"
#define MAX_TOKEN_LEN 128
char blaststr[20000];
void main (int argc, char**argv)
{

int devNum;
char keyName[MAX_TOKEN_LEN];
unsignedchar outstr[1024];
char hexstr[1024];
char charstr[10];
unsignedint i, j;
int size;
printf("Version 1.0\n");
printf("Type in 1 for code library keys or 0 to learn\n");
scanf("%d", &devNum);
if (devNum)
{
while(1) {

printf("UEI type values are:\n0=TV, 1=Cable, 2=Video Accessory, 3=Satellite, 4=VCR, 5=Laser Disk,\n6=DVD, 7=Tuner/Amp, 8=Amp/Misc. Audio, 9=CD, 10=Home Control\n");

printf("There are thousands of UEI code values representing different manufacturers.\nConsult mytvstore.com/support.html for a list of them\n");printf("UEI key values vary by device\n");
printf("As an example, the sequence 4,162,16 represents VCR,Panasonic,POWER.\n");
printf("Input \'ueitype,ueicode,key,key...\'\n");
scanf("%s", keyName);
printf("\n");
Emit(keyName);
}

return;

}
else
{
for (j=0; j<3; j++)
{
printf("press and hold custom key to learn (5 seconds)\n");
if (LearnDeviceKey(&size, outstr, j+1) == 0) {
printf("outstr=");
hexstr[0] = '\0';
for (i=0; i<(unsignedint)size; i++)
{
sprintf(charstr, "%.2X", outstr[i]);
printf(charstr);strcat(hexstr, charstr);
}
printf("\n");
}
while (1)
{
printf("type next to record the next key or any other word to output the last learned key\n");
scanf("%s", keyName);
if (!stricmp(keyName, "NEXT")) break;
EmitLearned(hexstr);
}
}
return;
}
}


Gracias de Antemano

Carlosmm

Última edición por carlosmoralesm fecha: 06-01-2005 a las 01:21:09. Razón: correccion
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 22:43:56.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi