有没有熟悉ActiveMQ的大神!??困扰很久了,准备学习JMS,求帮助!

不知道是哪里配置不对,跟着网上码的一个例子,求大神指教!

INFO | Successfully connected to tcp://localhost:61616
javax.jms.JMSSecurityException: User name [null] or password is invalid.
at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:52)
at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1398)
at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1501)
at org.apache.activemq.ActiveMQConnection.start(ActiveMQConnection.java:522)
at com.whitewind.activemq.JMSProducer.main(JMSProducer.java:42)
Caused by: java.lang.SecurityException: User name [null] or password is invalid.
at org.apache.activemq.security.JaasAuthenticationBroker.authenticate(JaasAuthenticationBroker.java:89)
at org.apache.activemq.security.JaasAuthenticationBroker.addConnection(JaasAuthenticationBroker.java:68)
at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:97)
at org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:102)
at org.apache.activemq.broker.TransportConnection.processAddConnection(TransportConnection.java:817)
at org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddConnection(ManagedTransportConnection.java:77)
at org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:139)
at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:338)
at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:188)
at org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50)
at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113)
at org.apache.activemq.transport.AbstractInactivityMonitor.onCommand(AbstractInactivityMonitor.java:300)
at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:214)
at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:196)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.security.auth.login.FailedLoginException: user name is null
at org.apache.activemq.jaas.PropertiesLoginModule.login(PropertiesLoginModule.java:84)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at javax.security.auth.login.LoginContext.invoke(Unknown Source)
at javax.security.auth.login.LoginContext.access$000(Unknown Source)
at javax.security.auth.login.LoginContext$4.run(Unknown Source)
at javax.security.auth.login.LoginContext$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(Unknown Source)
at javax.security.auth.login.LoginContext.login(Unknown Source)
at org.apache.activemq.security.JaasAuthenticationBroker.authenticate(JaasAuthenticationBroker.java:84)
... 15 more

2个回答

图片说明

用户名密码出问题了 先不要从配置文件获取 先写死试一下

csdn_Leoz
csdn_Leoz 用户名system 密码manager 结果还是报错无效
大约 2 年之前 回复
csdn_Leoz
csdn_Leoz 你好,谢谢回答。我试了用户名
大约 2 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
困扰很久了!
program Project1;rnusesrn Forms,rn Unit1 in 'Unit1.pas' MDIForm,rn Unit2 in 'Unit2.pas' LogoForm;rnrn$R *.resrnrnbeginrn Application.Initialize;rn logoform:=Tlogoform.Create(application);rn logoform.Show;rn logoform.Update;rn Application.CreateForm(TMDIForm, MDIForm);rn Application.Run;rnend.rnrn// 以上程序LOGO太短,一闪而过,有什么办法延长些啊?rn//如果要在LOGOFORM增加一些验证用户的功能,能做到么?rnrnrn给50分!rn
困扰我好久了。。。。。。求大神解答~
private Address[] read() throws Exceptionrn Address[] addressArray = new Address[getLineCounts()];rn Scanner scanner = new Scanner(new File("address.txt"));rn int i=0;rn while(scanner.hasNext())rn String[] array = scanner.nextLine().split(",");//line =1,111,111,111,111,111rn [color=#FF0000]addressArray[i++] = new Address(Integer.parseInt(array[0]),array[1],[/color]rn array[2],array[3],array[4]);rn rn return addressArray;rn rn变红的那行出错了,我都快愁死了。。。。。不知道为啥出错,说是找不到符号。
Jms 之 ActiveMQ学习资料
ActiveMQ学习资料 linux下activemq安装
困扰了很久了,新手求指点!
includern#includernint main(int argc,char*argv[])rnrn int ch;rn FILE* fp;rn long count =0;rn if(argc!=2)rn rn printf("Usage: %s filename\n",argv[0]);rn exit(1);rn rn if((fp=fopen(argv[1],"r"))==NULL)rn rn printf("can not open %s\n",argv[1]);rn exit(1);rn rn while((ch=getc(fp))!=EOF)rn rn putc(ch,stdout);rn count++;rn rn fclose(fp);rn printf("File %s have %ld characters\n",argv[1],count);rn return 0;rnrn为什么我无法打开文件呢?是不是我打开的文件必须要和程序的可执行文件在同一个目录下?还是其他的什么原因?
求高手解决问题啊。。。困扰很久了。
WebContext(/PMRS) ,ERROR: action: nullrn+ org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'busExeProjectDAO' defined in file [/web_data/pmrs.war/WEB-INF/classes/spring/businessdao.xml]: Can't resolve reference to bean 'PagePmrClient' while setting property 'sqlMapClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'PagePmrClient' defined in file [/web_data/pmrs.war/WEB-INF/classes/spring/database.xml]: Initialization of bean failed; nested exception is java.lang.RuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0xd8e8) was found in the element content of the document.rn+ org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'PagePmrClient' defined in file [/web_data/pmrs.war/WEB-INF/classes/spring/database.xml]: Initialization of bean failed; nested exception is java.lang.RuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0xd8e8) was found in the element content of the document.rn+ java.lang.RuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0xd8e8) was found in the element content of the document.rn+ at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:89)rn+ at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:63)rn+ at org.springframework.orm.ibatis.SqlMapClientFactoryBean.afterPropertiesSet(SqlMapClientFactoryBean.java:258)rn+ at com.ibatis.sqlmap.client.spring.CustomSqlMapClientFactoryBean.afterPropertiesSet(CustomSqlMapClientFactoryBean.java:19)rn+ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1058)rn+ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:363)rn+ at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)rn+ at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)rn+ at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:176)rn+ at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:105)rn+ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1012)rn+ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:823)rn+ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:345)rn+ at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:239)rn+ at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)rn+ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByName(AbstractAutowireCapableBeanFactory.java:843)rn+ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:811)rn+ at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:345)rn+
消息中间件 activeMQ 及 JMS 学习
1、消息中间件         消息中间件利用高效可靠的消息传递机制进行平台无关的数据交流,并基于数据通信来进行分布式系统的集成。通过提供消息传递和消息排队模型,它可以在分布式环境下扩展进程间的通信。对于消息中间件,常见的角色大致也就有Producer(生产者)、Consumer(消费者)。 常见的消息中间件产品: (1)ActiveMQ ActiveMQ 是Apache出品,最流行的,能...
jms 的简单应用中遇到的问题,困扰我很久了
代码如下:rn[code=Java]rnpackage myjms;rnrnimport java.util.Properties;rnrnimport javax.naming.*;rnimport javax.jms.*;rnrnrnpublic class MessageProducter rn private final static String JMSCF_JNDI_NAME = "jms/tcf";rn private final static String JMSQ_JNDI_NAME = "jms/tq";rn private final static String messageText = "Package Received - 24595023";rn rn public static void main(String[] args) throws Exception rn Properties props=new Properties(); rn props.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");rn props.put(Context.PROVIDER_URL,"iiop://localhost:900");rn rn InitialContext initCtx = new InitialContext(props);rn rn // Finding the WAS QueueConnectionFactoryrn javax.jms.ConnectionFactory qcf = (javax.jms.ConnectionFactory) initCtx.lookup(JMSCF_JNDI_NAME);rn // Finding the Queue Destinationrn Destination q = (Destination) initCtx.lookup(JMSQ_JNDI_NAME);rn // Create JMS Connectionrn Connection connection = qcf.createConnection();rn // Create JMS Sessionrn Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);rn // Create MessageProducer and TextMessagern MessageProducer queueSender = session.createProducer(q);rn TextMessage outMessage = session.createTextMessage();rn outMessage.setText(messageText);rn // Set type and destination and sendrn outMessage.setJMSType("package_received");rn outMessage.setJMSDestination(q);rn queueSender.setDeliveryMode(DeliveryMode.NON_PERSISTENT);rn queueSender.send(outMessage);rn rn connection.close(); rn System.out.println("Send completed");rn rnrnrn[/code]rnrn使用的是websphere6.1 JMS 默认的提供程序..rnconnectionFactory jndi name: "jms/tcf"rnqueue jndi name :"jms/tq"rn执行以上程序出现以下错误:rnrn[code=Java]rn Exception in thread "P=193921:O=0:CT" java.lang.NoClassDefFoundError: org.jboss.mx.util.Serializationrn at javax.management.ObjectName.(ObjectName.java:86)rn at java.lang.J9VMInternals.initializeImpl(Native Method)rn at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)rn at java.lang.Class.forNameImpl(Native Method)rn at java.lang.Class.forName(Class.java:131)rn at javax.management.remote.rmi.RMIConnectionImpl_Stub.class$(RMIConnectionImpl_Stub.java:6)rn at javax.management.remote.rmi.RMIConnectionImpl_Stub.(RMIConnectionImpl_Stub.java:41)rn at java.lang.J9VMInternals.initializeImpl(Native Method)rn at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)rn at java.lang.Class.forNameImpl(Native Method)rn at java.lang.Class.forName(Class.java:131)rn at javax.management.remote.rmi.RMIConnector.(RMIConnector.java:2006)rn at java.lang.J9VMInternals.initializeImpl(Native Method)rn at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)rn at sun.misc.Unsafe.ensureClassInitialized(Native Method)rn at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43)rn at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:150)rn at java.lang.reflect.Field.acquireFieldAccessor(Field.java:945)rn at java.lang.reflect.Field.getFieldAccessor(Field.java:926)rn at java.lang.reflect.Field.get(Field.java:385)rn at com.ibm.CORBA.iiop.UtilDelegateImpl$2.run(UtilDelegateImpl.java:178)rn at java.security.AccessController.doPrivileged(AccessController.java:192)rn at com.ibm.CORBA.iiop.UtilDelegateImpl.(UtilDelegateImpl.java:170)rn at java.lang.J9VMInternals.initializeImpl(Native Method)rn at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)rn at java.lang.J9VMInternals.initialize(J9VMInternals.java:144)rn at java.lang.Class.newInstanceImpl(Native Method)rn at java.lang.Class.newInstance(Class.java:1263)rn at javax.rmi.CORBA.Util.createDelegateIfSpecified(Util.java:359)rn at javax.rmi.CORBA.Util.(Util.java:70)rn at java.lang.J9VMInternals.initializeImpl(Native Method)rn at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)rn at com.ibm.rmi.corba.PluginRegistry.instantiatePlugins(PluginRegistry.java:116)rn at com.ibm.rmi.corba.ORB.instantiatePlugins(ORB.java:1386)rn at com.ibm.rmi.corba.ORB.orbParameters(ORB.java:1298)rn at com.ibm.rmi.corba.ORB.set_parameters(ORB.java:1206)rn at com.ibm.CORBA.iiop.ORB.set_parameters(ORB.java:1662)rn at org.omg.CORBA.ORB.init(ORB.java:364)rn at com.ibm.ws.orb.GlobalORBFactory.init(GlobalORBFactory.java:86)rn at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:179)rn at com.ibm.ejs.oa.EJSClientORBImpl.(EJSClientORBImpl.java:83)rn at com.ibm.ejs.oa.EJSClientORBImpl.(EJSClientORBImpl.java:59)rn at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:102)rn at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:309)rn at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:392)rn at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:117)rn at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:712)rn at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:171)rn at javax.naming.InitialContext.lookup(InitialContext.java:363)rn at myjms.MessageProducter.main(MessageProducter.java:22)rn[/code]rn这个困扰我很久了,望高人帮帮我。。万分感谢。rn
一个问题,困扰很久了,
有两个页面,当在第一个页面输入完并关闭时(),如何让第二个页面取得此植?前提不能刷新第二个页面,因为此时第二个页面也有一些输入框并已经输入了内容rnrnrn
PaushSource的问题。困扰很久了。
一个FilterGraph 执行IMediaControl的Pause方法后暂停下来,但我的PaushSource Filter(继承自CSource和CSourceStream) 还在不停的发数据,也就是它的FillBuffer方法仍被不停的调用,为了让它暂停下来,我给这个PaushSource Filter做了一个外部接口在PAUSE时通知它,并让FillBuffer中返回S_FALSE.这样它会停止发送,但在暂停结束后我执行IMediaControl的Run方法后,PaushSource Filter则不再发数据。如何让它重新发数据呢?或者有什么更好的方法来解决这个问题。
数据库连接问题!困扰很久了
我的是一个定时程序,每到时间就会运行两个方法rn 其中两个方法分别为A和B ,rn程序先运行A方法,完后紧接着运行B 方法,rn A方法和B 方法都连接一个不同的数据库,rnrn我的问题是:现在运行B方法出现了 错误:rnrnCannot allocate more connections. Connection pool is at maximum. Increase Max Pool Sizernrn可是A方法运行正常,rnrnrn重启程序,A,B方法运行都正常,不过过一段时间(3-4天吧)B方法又会出现上面的问题rnB方法数据库连接:rn[code=C#]rn public DataTable GetDataFromSybase(string sql)rn rn string configString = SybaseConstr;rn using (AseConnection connection = new AseConnection(configString))rn rn using (AseCommand cmd = new AseCommand(sql, connection))rn rn tryrn rn cmd.CommandTimeout = 30;rn connection.Open();rn AseDataAdapter ada = new AseDataAdapter(cmd);rn DataSet ds = new DataSet();rn ada.Fill(ds);rn connection.Close();rn connection.Dispose();rn return ds.Tables[0];rn rn catch (Sybase.Data.AseClient.AseException e)rn rn connection.Close();rn connection.Dispose();rn throw (new Exception("Error in the Database" + e.Message));rn rn finallyrn rn connection.Close();rn connection.Dispose();rn rn rn rn rn[/code]rnrn
对 memfile 熟悉的请进, 这个问题困扰我很久了
HRESULT Read( PBYTE pbBuffer,rn DWORD dwBytesToRead,rn BOOL bAlign,rn LPDWORD pdwBytesRead)rn rn DWORD dwReadLength;rn rn dwReadLength = dwBytesToRead;rn ///////////////////////////handle bufrn //wait for add new data if smaller than SIZEBUFrn while (m_BufSize < dwReadLength)rn rn Sleep(10); //问题在这里: 播放第一个32768字节后就进入这里是循环了,再也没调用 AddBufrn rn rn WaitForSingleObject(hMutex, 1L); rnrn CopyMemory((PVOID)pbBuffer, (PVOID)m_PlayBuf,dwReadLength);rn m_BufSize -= dwReadLength;rn rn ReleaseMutex(hMutex);rnrnrn //move data of not play to head our buf rn CopyMemory((PVOID)m_PlayBuf, (PVOID)(m_PlayBuf+dwReadLength),m_BufSize);rn rn m_llPosition += dwReadLength;rn *pdwBytesRead = dwReadLength;rn return S_OK;rn rnrn LONGLONG AddBuf(PBYTE buf)rn rn //if greater than bufsize return -1rn if ((m_BufSize+SIZEBUF) > (SIZEBUF*(READBUF+1)))rn rn return -1;rn rn rn //add new datarn WaitForSingleObject(hMutex, 1L); rn rn CopyMemory((PVOID)(m_PlayBuf+m_BufSize),(PVOID)buf,SIZEBUF); rn m_BufSize += SIZEBUF; rn rn ReleaseMutex(hMutex);rn rn //data of not play had increasernrn return m_BufSize;rn rnrn媒体类型设置如下:rnmt.majortype = MEDIATYPE_Stream;rnmt.subtype = GUID_NULL;rnrn如果 网络传过来的数据没有音频, 根本无法播放, 而在本地读取一个没有音频流的文件却能播放rnrn网络传过来数据,有时候能播放成功,有时候不能rnrn因为是网络传过来的数据,我在每次开始,我都向缓冲发送一个 mpeg系统头,会不会是这个系统头有问题? 但是有时候怎么又成功了呢?rnrn如果分不够,还可以开贴!rnrn
很奇怪的问题 困扰我很久了
一条SQL语句在SQL Server 2005的Managment Studio中执行很快(0-1秒)的时间,在.net应用程序中却要5-6分钟才出来rn返回的结果也就4000条行,SQL Server Profiler跟踪的结果是执行下面的SQL花了很长时间rn请各位高手帮我看看,SQL Server的版本2005企业版SP2,硬件是双4核CPU,16G内存rnrnEXEC sp_executesqlrnN'SELECT i.DataAreaId, i.ItemId, q.ConfigId, c.ItemStatusrn , q.InventQty, imi.UnitId, imp.DeliveryTimern , ItemType = e1.ElementNameENG, i.ItemGroupIdrn , i.ItemCategory, i.ItemNamern , ItemBuyer = eb.Name, ItemSouring = es.Namern , i.PrimaryVendorId, VendorName = v.NamernFROM AX4.dbo.InventTable irnINNER JOIN AX4.dbo.DataAreaCompany yrnON y.DataArea = i.DataAreaIdrnINNER JOIN AX4.dbo.InventTableModule imirnON imi.ItemId = i.ItemIdrn AND imi.ModuleType = 0rn AND imi.DataAreaId = i.DataAreaIdrnINNER JOIN AX4.dbo.InventTableModule imprnON imp.ItemId = i.ItemIdrn AND imp.ModuleType = 1rn AND imp.DataAreaId = i.DataAreaIdrnINNER JOIN dbo.AxEnum e1rnON e1.EnumName = N''ItemType''rn AND e1.ElementValue = i.ItemTypernLEFT JOINrn(rn SELECT s.DataAreaId, s.ItemId, d.ConfigIdrn , InventQty = CAST(CAST(SUM(CASE WHEN d.InventLocationId = N''MRB'' THEN 0 ELSE s.PhysicalInvent END) AS NUMERIC(20, 2)) AS FLOAT)rn FROM AX4.dbo.InventSum srn INNER JOIN AX4.dbo.InventDim drn ON d.InventDimId = s.InventDimIdrn AND d.DataAreaId = s.DataAreaIdrn WHERE s.Closed = 0rn GROUP BY s.DataAreaId, s.ItemId, d.ConfigIdrn HAVING SUM(s.PhysicalInvent) <> 0rn) qrnON i.ItemId = q.ItemIdrn AND i.DataAreaId = q.DataAreaIdrnLEFT JOIN AX4.dbo.ConfigTable crnON c.ItemId = q.ItemIdrn AND c.ConfigId = q.ConfigIdrn AND c.DataAreaId = q.DataAreaIdrnLEFT JOIN AX4.dbo.VendTable vrnON v.AccountNum = i.PrimaryVendorIdrn AND v.DataAreaId = i.DataAreaIdrnLEFT JOIN AX4.dbo.EmplTable ebrnON eb.EmplId = i.ItemBuyerGroupIdrn AND eb.DataAreaId = i.DataAreaIdrnLEFT JOIN AX4.dbo.EmplTable esrnON es.EmplId = i.Souringrn AND es.DataAreaId = i.DataAreaIdrnWHERE i.ItemType <> 3rn AND i.DataAreaId = @Companyrn AND i.ItemId = ISNULL(@ItemId, i.ItemId)rn AND CASE WHEN @ItemId IS NULL AND q.InventQty IS NULL THEN 0 ELSE 1 END = 1rnORDER BY i.DataAreaId, i.ItemId, q.ConfigId', N'@Company nvarchar(3), @ItemId nvarchar(60)'rn, @Company = N'itc', @ItemId = nullrn
困惑很久了!!!!!求大神解决
怎么让计算结果保留4位有效数字?不是那种通过setprecision(n)函数来控制的,是那种结果本身已经保留,正常输出就行。rn像我这个处理方法不是太好,不能输出.0000这个种情况,而且如果area是个很大的数时就会溢出。。rn#include rn#includernusing namespace std;rnrnint main()rnrn double a,b,c;rn cout<<"输入三角形的边长";rn cin>>a>>b>>c;rn if(a+b>c&&b+c>a&&a+c>b)rn rn double l,area;rnrn l=(a+b+c)/2;rn area=int((sqrt(l*(l-a)*(l-b)*(l-c)))*10000+0.5);rn area=area/10000;rn cout<
【JMS】JMS之ActiveMQ的使用
这篇文章主要是简单介绍一下JMS和ActiveMQ,以及使用ActiveMQ来写两个demo。1. JMS是啥百度百科的解释: JMS即Java消息服务(Java Message Service)应用程序接口,是一个Java平台中关于面向消息中间件(MOM)的API,用于在两个应用程序之间,或分布式系统中发送消息,进行异步通信。Java消息服务是一个与具体平台无关的API,绝大多数MOM提供商都
JMS之ActiveMQ(二):简单学习
参考上一章JMS对象模型图测试Queue和Topic两种目的类型,代码如下import org.apache.activemq.ActiveMQConnectionFactory; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBo...
JMS学习九(ActiveMQ集群)
上一篇文章中我们说到了失效转移(failover),网络连接器(networkconnection),下面我们就来实践一下即搭建Broker集群,Broker集群的搭建就使用到了failover和networkconnection,如果对failover和networkconnection不了解的可以看看上一篇文章,这里就不重复。 如果应用的访问量不大或者说使用ActiveMQ进行消息发送量不大
JMS ActiveMQ
MQ简介、JMS基础、ActiveMQ基础应用、ActiveMQ高级特性
activemq jms
NULL 博文链接:https://xiaolng.iteye.com/blog/2265328
困扰很久的问题!!求大神帮助!!!
ssh项目整合的时候出现空指针异常。rnrn //strust和spring整合中按名称自动注入的业务层类rn private ProductService productService; 这个地方如果new一个 ProductService就没问题了,如果不new就空指针异常。rn rn public void setProductService(ProductService productService) rn this.productService = productService;rn [color=#FF0000][/color]
JMS学习十三(ActiveMQ安全)
在第二篇文章中提到了修改用户名密码的方式,下面来看看ActiveMQ连接安全问题: 一、客户端连接服务端 如果消息服务器activemq.xml中设置了用户名、密码则消息生产者和消息消费者连接到消息服务器是如果用户名密码和消息服务器设定的不一样则不能发送或消息消息的。 1、activemq.xml 配置文件中进行配置:
JMS学习之ActiveMQ简介与安装
最近做的项目中涉及到消息队列管理,用到了ActiveMQ,借此记录下学习使用过程。一、有关JMS的基本概念,下面链接的这篇博客写的比较详细:   http://blog.csdn.net/jiuqiyuliang/article/details/46701559二、ActiveMQ 简介与安装   以下这篇博客介绍了ActiveMQ以及在windows上的安装:   http://blog.c
tomcat启动的问题,请大神帮忙解决,困扰很久了~~~~~~
[img=https://img-bbs.csdn.net/upload/201311/20/1384930040_977509.jpg][/img][img=https://img-bbs.csdn.net/upload/201311/20/1384930059_55064.jpg][/img]
有没有熟悉webservice的大神
[code=java]rnpublic static void test2() rn try rn // 1.创建service对象,通过axis自带的类创建rn Service service = new Service();rn // 2.创建url对象rn String wsdlUrl = "http://webservice.webxml.com.cn/WebServices/TraditionalSimplifiedWebService.asmx";// 请求服务的URLrn URL url = new URL(wsdlUrl);// 通过URL类的构造方法传入wsdlUrl地址创建URL对象rn // 2.创建服务方法的调用者对象call,设置call对象的属性rn Call call = (Call) service.createCall();rn call.setSOAPActionURI("http://webxml.com.cn/toTraditionalChinese");rn call.setUseSOAPAction(true);rn call.setTargetEndpointAddress(url);//给call对象设置请求的URL属性rn String serviceName = "toTraditionalChinese";rn call.setOperationName(serviceName);// 给call对象设置调用方法名属性rn call.addParameter("sText", XMLType.XSD_STRING, ParameterMode.IN);// 给call对象设置方法的参数名、参数类型、参数模式rn call.setReturnType(XMLType.XSD_STRING);// 设置调用方法的返回值类型rn // 4.通过invoke方法调用webservicern String str = "阳";rn String res = (String) call.invoke(new Object[] str);// 调用服务方法rn System.out.println("|" + res + "|");rn catch (MalformedURLException e) rn e.printStackTrace();rn catch (ServiceException e) rn e.printStackTrace();rn catch (RemoteException e) rn e.printStackTrace();rn rn rn[/code]rn这个是我自已写的一段代码 调用后返回值为空 又没有报错 不知道为什么 请大神指教
jms之ActiveMQ
ActiveMQ的原理及其应用详解,有详细的图解和说明。
GridView更新时错误,希望有人帮助。困扰很久了!
页面代码:rnrn rn rn rn rnrn====================================================================rn后台代码:rnprotected void grv1_RowDataBound(object sender, GridViewRowEventArgs e)rn rn if (e.Row.RowIndex==grv1.EditIndex)rn rn e.Row.Cells[0].Controls.Clear();rn DropDownList ddl = new DropDownList();rn ddl.Items.Add("已维修");rn ddl.Items.Add("维修中");rn ddl.Items.Add("未维修");rn e.Row.Cells[0].Controls.Add(ddl); rn rn rnrnprotected void grv1_RowUpdating(object sender, GridViewUpdateEventArgs e)rn rn[color=#FF0000] DropDownList ddl = (DropDownList)grv1.Rows[e.RowIndex].Cells[0].Controls[0]; // 运行到这里出错了,提示不能将TextBox转换为DropDownList。[/color]rn ......rn grv1.EditIndex = -1;rn BindData();rn
JMS与ActiveMQ
 JMS是一种与厂商无关的 API,用来访问消息收发系统。它类似于 JDBC(Java Database Connectivity):这里,JDBC 是可以用来访问许多不同关系数据库的 API,而 JMS 则提供同样与厂商无关的访问方法,以访问消息收发服务。许多厂商目前都支持 JMS,包括 IBM 的 MQSeries、BEA的 Weblogic JMS service和 Progress 的 SonicMQ,这只是几个例子。 JMS 使您能够通过消息收发服务(有时称为消息中介程序或路由器)从一个 JMS 客户机向另一个 JMS客户机发送消息。消息是 JMS 中的一种类型对象,由两部分组成:报头和消息主体。报头由路由信息以及有关该消息的元数据组成。消息主体则携带着应用程序的数据或有效负载。根据有效负载的类型来划分,可以将消息分为几种类型,它们分别携带:简单文本 (TextMessage)、可序列化的对象 (ObjectMessage)、属性集合 (MapMessage)、字节流 (BytesMessage)、原始值流 (StreamMessage),还有无有效负载的消息 (Message)。
恳请知道的人帮助下 这个问题困扰我很久了
关于com组件调用的问题,我想获取鼠标点击某个文件或者同时选择多个文件的文件名 看了网上一些资料 IShellExtInit这个接口可以做到 rn下面这是一个atl工程部分源码rnclass ATL_NO_VTABLE CSimpleShlExt : rn public CComObjectRootEx,rn public CComCoClass,rn public ISimpleShlExt,rn public IShellExtInit//这是自己添加的rnrnpublic:rn CSimpleShlExt()rnDECLARE_REGISTRY_RESOURCEID(IDR_SIMPLESHLEXT)rnDECLARE_NOT_AGGREGATABLE(CSimpleShlExt)rnrnrnDECLARE_PROTECT_FINAL_CONSTRUCT()rnrnBEGIN_COM_MAP(CSimpleShlExt)rn COM_INTERFACE_ENTRY(ISimpleShlExt)rn COM_INTERFACE_ENTRY(IShellExtInit)//这是自己添加的rnEND_COM_MAP()rnrn// ISimpleShlExtrnprotected: rnTCHAR m_szFile [MAX_PATH]; rnpublic: rn // IShellExtInit rn LPCSTR getFileName;rn STDMETHOD(Initialize)(LPCITEMIDLIST pidlFolder, LPDATAOBJECT pdtobj, HKEY hProgID); rn STDMETHOD(get_str)(LPCSTR a,LPCSTR *b);//为了测试用的 自己定义了一个get_str方法 rn rn;rnrn然后在cpp定义文件中 实现rnHRESULT CSimpleShlExt::Initialize ( LPCITEMIDLIST pidlFolder, LPDATAOBJECT pdtobj, HKEY hProgID )rnrn....rn....rn for( UINT uIndex = 0; uIndex < uCount; uIndex++ ) rn rn TCHAR szFileName[MAX_PATH] = 0 ;rn //获取文件名rn ::DragQueryFile(hDrop, uIndex, szFileName, (sizeof(szFileName) / sizeof(TCHAR)) - 1);rn //szFileName为文件(夹)名rn rnrnszFileName这是获取的文件夹名 现在的问题是 我怎么得到这个文件夹名呢?rn我新建了个win32 Console Application 对这个com组件进行调用 rn下面是调用过程rn#include "Debug/demo_SimpleExt.h"rn#include "Debug/demo_SimpleExt_i.c"rnrnint main()rnrn ::CoInitialize(NULL);rn HRESULT hr;rn ISimpleShlExt* pIntf=NULL;rn hr = CoCreateInstance(CLSID_SimpleShlExt, NULL, CLSCTX_SERVER , IID_ISimpleShlExt, (void **)& pIntf);rn if(SUCCEEDED(hr))rn rn LPCSTR lp;rn pIntf->get_str("aaaa",&lp);rn cout<Release();rn rn ::CoUninitialize();rnrnrnrn得出的结果是可以输出aaaa的 说明调用组件是成功了 但是我不知道如何得到com组件中szFileName这个文件名的值 这个问题困扰我很久了 请教下大家
有没有熟悉OpenGL的大神?求救急!!!
我想用OpenGL实现对一个三维模型进行纹理贴图,求帮助
学习困难求大神帮助
public class ChatReceive extends Thread rn rn @Overridern public void run() rn try rn //建立udp的服务,要监听一个端口rn DatagramSocket socket = new DatagramSocket(9090);rn //准备空的数据包存储数据rn byte[] buf = new byte[1024];rn DatagramPacket packet = new DatagramPacket(buf, buf.length);rn [color=#FF0000] boolean flag = true;rn while(flag)rn socket.receive(packet);rn // packet.getAddress() 获取对方数据 包的IP地址对象。rn System.out.println(packet.getAddress().getHostAddress()+"说:"+new String(buf,0,packet.getLength()));rn rn //关闭资源rn socket.close();[/color]rn rn catch (IOException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rn rn rnrn为什么关闭资源时候需要声明一个boolean变量,把while条件改成true不行吗…public class ChatReceive extends Thread rn rn
JMS 中间件:activeMQ, JMS 入门
JMS入门,使用activeMQ 发送,接收消息。首先,下载 apache-activemq-5.4.0。http://activemq.apache.org/download.html,解压,然后双击 bin/activemq.bat。把 activemq-all-5.3.0.jar 加入 classpath. 构建Sender.java 和Receiver.java : import ja...
【ActiveMQ】JMS中间件ActiveMQ详解
1.JMS介绍 Java Message Service(JMS)是SUN提出的旨在统一各种MOM(Message-Oriented Middleware )系统接口的规范,它包含点对点(Point to Point,PTP)和发布/订阅(Publish/Subscribe,pub/sub)两种消息模型,提供可靠消息传输、事务和消息过滤等机制。 简单的说,JMS制定了一个发消息的规范,是一个与具
问一个 数据库的问题 困扰很久了
网站的数据 比较大 1000万的样子rnrn是产品数据库 放了 不同公司的产品 每个公司 可以会出现产品相同的情况rnrnrnrn要求 一页显示4条记录 符合条件的数据都要显示 每一页只显示一个公司 ,到后面没有符合4个公司的数据 可以出现重复公司 排序方法 是 按 时间 desc 产品 asc rnrnrn搜索 汽车 这个词语rnrnrnrncreate table #temprn(rn company varchar(50),rn product varchar(50),rn inputDate datetimern)rnrninsert into #temp(company,product,inputDate) values('杭州大明有限公司','汽车1','2010-8-1')rninsert into #temp(company,product,inputDate) values('杭州大明有限公司','汽车2','2010-8-1')rninsert into #temp(company,product,inputDate) values('杭州大明有限公司','汽车3','2010-8-1')rninsert into #temp(company,product,inputDate) values('杭州大明有限公司','汽车4','2010-8-1')rninsert into #temp(company,product,inputDate) values('杭州大明有限公司','汽车5','2010-7-1')rnrninsert into #temp(company,product,inputDate) values('北京小科有限公司','汽车1','2010-8-1')rninsert into #temp(company,product,inputDate) values('北京小科有限公司','汽车2','2010-8-1')rninsert into #temp(company,product,inputDate) values('北京小科有限公司','汽车3','2010-8-1')rninsert into #temp(company,product,inputDate) values('北京小科有限公司','汽车4','2010-8-1')rnrninsert into #temp(company,product,inputDate) values('上海有得有限公司','汽车1','2010-8-1')rninsert into #temp(company,product,inputDate) values('上海有得有限公司','汽车2','2010-8-1')rninsert into #temp(company,product,inputDate) values('上海有得有限公司','汽车3','2010-8-1')rninsert into #temp(company,product,inputDate) values('上海有得有限公司','汽车4','2010-8-1')rnrninsert into #temp(company,product,inputDate) values('天津旺旺有限公司','汽车4','2010-8-1')rninsert into #temp(company,product,inputDate) values('天津旺旺有限公司','汽车5','2010-8-1')rnrnrnrnselect * from #temprnrndrop table #temprnrn rnrnrnrnrn第一页rn杭州大明有限公司 汽车1 2010-8-1rn北京小科有限公司 汽车1 2010-8-1rn上海有得有限公司 汽车1 2010-8-1rn天津旺旺有限公司 汽车4 2010-8-1rnrn第二页rn杭州大明有限公司 汽车2 2010-8-1rn北京小科有限公司 汽车2 2010-8-1rn上海有得有限公司 汽车2 2010-8-1rn天津旺旺有限公司 汽车5 2010-8-1rnrn第三页rn杭州大明有限公司 汽车3 2010-8-1rn北京小科有限公司 汽车3 2010-8-1rn上海有得有限公司 汽车3 2010-8-1rn杭州大明有限公司 汽车4 2010-8-1 rnrnrn第四页rnrn北京小科有限公司 汽车4 2010-8-1rn上海有得有限公司 汽车4 2010-8-1rn杭州大明有限公司 汽车5 2010-7-1 rnrnrn需要用分页存储过程,因为数据量 比较大 rnrnrnrn
求助Frame的问题,困扰了很久了
我又一个这样的页面:rn 第一个framern ┌─────────────────┐rn │    Top.htm │rn ├─────────────────┤rn │     下面是第二个frame    │rn │  ┌──┬──────┬──┐ │rn │  │  │      │  │ │rn │  │left│ main │righ│ │rn │ │.asp│ .asp │.asp│ │rn │ │ │ │ │ │rn │ └──┴──────┴──┘ │rn │                 │rn └─────────────────┘rnrn我怎么样才能在top.htm中操作left.asp的显示和隐藏呢?rn我试了很多,不行啊。
很菜的基础问题,困扰我很久了
问题有点多,请逐一回答,谢谢了啊。rnrn1、原始套接字和 数据流套接字有什么区别?rnrn我所知道的:原始套接字可以 可以写pingrnrn而数据流则不可以。 rnrnrn2. 为什么要bind????rnrn我 看过一个端口扫描的工具的代码,它里面就没有bind,而是是直接connet对方??rnrn请问什么情况该bind? 什么时候不必bind!!rnrnrn问题3. vc6与 winsock2的关系,是不是vc6默认是winsock1??rnrnrn问题4.INADDR_ANY的意思是 什么?rnrn为什么在写嗅探工具的时候,必须制定一个本地地址,不能用INADDR_ANY ??rnrn问题5、h_addr_list[0] 是什么意思啊??rnrnrn谢谢大家了啊。rnrnrn踊跃回答啊rnrn
这个问题困扰我很久了
机器中原有windows2000,后来我装了linux,当我的windows2000坏掉要重装的时候麻烦就来了,装完新的2000,原来的linux分区就变得找不到了,linux也没法用了,向各位高手请教。
Directx 3D 程序问题(困扰很久了)
#include rnLPDIRECT3D9 g_pD3D = NULL; //Direct3D对象rnLPDIRECT3DDEVICE9 g_pd3dDevice = NULL; //Direct3D设备对象rnLPD3DXMESH g_pMesh = NULL; //网格模型对象rnD3DMATERIAL9* g_pMeshMaterials = NULL; //网格模型材质rnLPDIRECT3DTEXTURE9* g_pMeshTextures = NULL; //网格模型纹理rnDWORD g_dwNumMaterials = 0L; //网格模型材质数量rnrnVOID SetWorldMatrix()rnrn D3DXMATRIXA16 matWorld;rn D3DXMatrixRotationY( &matWorld, timeGetTime()/1000.0f );rn g_pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );rnrnVOID SetViewAndProjMatrix()rnrn D3DXVECTOR3 vEyePt( 0.0f, 10.0f,-20.0f );rn D3DXVECTOR3 vLookatPt( 0.0f, 0.0f, 0.0f );rn D3DXVECTOR3 vUpVec( 0.0f, 1.0f, 0.0f );rn D3DXMATRIXA16 matView;rn D3DXMatrixLookAtLH( &matView, &vEyePt, &vLookatPt, &vUpVec );rn g_pd3dDevice->SetTransform( D3DTS_VIEW, &matView );rn D3DXMATRIXA16 matProj;rn D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI/4, 1.0f, 1.0f, 100.0f );rn g_pd3dDevice->SetTransform( D3DTS_PROJECTION, &matProj );rnrnHRESULT InitD3D( HWND hWnd )rnrn if( NULL == ( g_pD3D = Direct3DCreate9( D3D_SDK_VERSION ) ) )rn return E_FAIL;rn D3DPRESENT_PARAMETERS d3dpp; rn ZeroMemory( &d3dpp, sizeof(d3dpp) );rn d3dpp.Windowed = TRUE;rn d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;rn d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;rn d3dpp.EnableAutoDepthStencil = TRUE;rn d3dpp.AutoDepthStencilFormat = D3DFMT_D16;rn if( FAILED( g_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING,&d3dpp, &g_pd3dDevice ) ) )rn rn return E_FAIL;rn rn g_pd3dDevice->SetRenderState( D3DRS_AMBIENT, 0xffffffff );rn SetViewAndProjMatrix();rn return S_OK;rnrnvoid RemovePathFromFileName(LPSTR fullPath, LPWSTR fileName)rnrn WCHAR wszBuf[MAX_PATH];rn MultiByteToWideChar( CP_ACP, 0, fullPath, -1, wszBuf, MAX_PATH );rn wszBuf[MAX_PATH-1] = L'\0';rn WCHAR* wszFullPath = wszBuf;rn LPWSTR pch=wcsrchr(wszFullPath,'\\');rn if (pch)rn lstrcpy(fileName, ++pch);rn elsern lstrcpy(fileName, wszFullPath);rnrnHRESULT InitGeometry()rnrn LPD3DXBUFFER pD3DXMtrlBuffer; //存储网格模型材质的缓冲区对象rn if( FAILED( D3DXLoadMeshFromX( L"airplane.x", D3DXMESH_MANAGED, g_pd3dDevice, NULL, &pD3DXMtrlBuffer, NULL, &g_dwNumMaterials, &g_pMesh ) ) )rn rn MessageBox(NULL, L"Could not find airplane.x", L"Mesh", MB_OK);rn return E_FAIL;rn rn D3DXMATERIAL* d3dxMaterials = (D3DXMATERIAL*)pD3DXMtrlBuffer->GetBufferPointer();rn g_pMeshMaterials = new D3DMATERIAL9[g_dwNumMaterials];rn if( g_pMeshMaterials == NULL )rn return E_OUTOFMEMORY;rn g_pMeshTextures = new LPDIRECT3DTEXTURE9[g_dwNumMaterials];rn if( g_pMeshTextures == NULL )rn return E_OUTOFMEMORY;rn for( DWORD i=0; i 0 )rn rn WCHAR filename[256];rn RemovePathFromFileName(d3dxMaterials[i].pTextureFilename, filename);rn if( FAILED( D3DXCreateTextureFromFile( g_pd3dDevice, filename, &g_pMeshTextures[i] ) ) )rn rn MessageBox(NULL, L"Could not find texture file", L"Mesh", MB_OK);rn rn rn rn pD3DXMtrlBuffer->Release(); rn return S_OK;rnrnVOID Cleanup()rnrn if( g_pMeshMaterials != NULL ) rn delete[] g_pMeshMaterials;rn if( g_pMeshTextures )rn rn for( DWORD i = 0; i < g_dwNumMaterials; i++ )rn rn if( g_pMeshTextures[i] )rn g_pMeshTextures[i]->Release();rn rn delete[] g_pMeshTextures;rn rn if( g_pMesh != NULL )rn g_pMesh->Release();rn rn //释放Direct3D设备对象rn if( g_pd3dDevice != NULL )rn g_pd3dDevice->Release();rn if( g_pD3D != NULL )rn g_pD3D->Release();rnrnVOID Render()rnrn g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0,0,255), 1.0f, 0 );rn if( SUCCEEDED( g_pd3dDevice->BeginScene() ) )rn rn SetWorldMatrix(); //设置世界矩阵rn for( DWORD i=0; iSetMaterial( &g_pMeshMaterials[i] );rn g_pd3dDevice->SetTexture( 0, g_pMeshTextures[i] );rn g_pMesh->DrawSubset( i );rn rn g_pd3dDevice->EndScene();rn rn g_pd3dDevice->Present( NULL, NULL, NULL, NULL );rnrnLRESULT WINAPI MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )rnrn switch( msg )rn rn case WM_DESTROY:rn Cleanup();rn PostQuitMessage( 0 );rn return 0;rn rn return DefWindowProc( hWnd, msg, wParam, lParam );rnrnINT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR, INT )rnrn WNDCLASSEX wc = sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L,GetModuleHandle(NULL), NULL, NULL, NULL, NULL L"ClassName", NULL ;rn RegisterClassEx( &wc );rn HWND hWnd = CreateWindow( L"ClassName", L"网格模型", WS_OVERLAPPEDWINDOW, 200, 100, 500, 500,GetDesktopWindow(), NULL, wc.hInstance, NULL );rn if( SUCCEEDED( InitD3D( hWnd ) ) )rn rn if( SUCCEEDED( InitGeometry() ) )rn rn ShowWindow( hWnd, SW_SHOWDEFAULT );rn UpdateWindow( hWnd );rn MSG msg; rn ZeroMemory( &msg, sizeof(msg) );rn while( msg.message!=WM_QUIT )rn rn if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )rn rn TranslateMessage( &msg );rn DispatchMessage( &msg );rn rn elsern rn Render(); //渲染场景rn rn rn rn rn UnregisterClass( L"ClassName", wc.hInstance );rn return 0;rnrn为什么我的这个程序运行了会有错误?rnd:\学习\d3d编程\mesh\mesh.cpp(102): error C2664: 'lstrcpyA' : cannot convert parameter 1 from 'LPWSTR' to 'LPSTR'rnd:\学习\d3d编程\mesh\mesh.cpp(120): error C2664: 'D3DXLoadMeshFromXA' : cannot convert parameter 1 from 'const unsigned short [11]' to 'LPCSTR'rn Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style castrnd:\学习\d3d编程\mesh\mesh.cpp(122): error C2664: 'MessageBoxA' : cannot convert parameter 2 from 'const unsigned short [26]' to 'LPCSTR'rn Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style castrnd:\学习\d3d编程\mesh\mesh.cpp(155): error C2664: 'D3DXCreateTextureFromFileA' : cannot convert parameter 2 from 'WCHAR [256]' to 'LPCSTR'rn Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style castrnd:\学习\d3d编程\mesh\mesh.cpp(268): error C2664: 'CreateWindowExA' : cannot convert parameter 2 from 'const unsigned short [10]' to 'LPCSTR'rn Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style castrn希望会的人教我,谢谢!
js控制下拉菜单,困扰很久了
这是js函数rn[code=JScript]rn rn[/code]rnrnrn这是页面rn[code=HTML]rn菜单rn rn rn dasfdsfsrn rn rn[/code]rnrn我想实现当鼠标移到“菜单”的时候,显示div,rn失去焦点的时候隐藏div,可是总是隐藏不了,有错误rn高手快来帮忙看看,rn原帖参考[url=http://topic.csdn.net/u/20090310/14/b096c132-aec8-4fe3-a20b-92cda83505d6.html][/url]
被这个问题困扰了很久了
用的是动态SQL方法四rn目的是要导出表里的字段名和数据rnrn具体代码如下:rn#include rn#include rn#include rn#include rn#include rnrn#include rnusing namespace std;rnrnrn#define MAX_NAME_LEN 31rn#define MAX_VAR_LEN 50rnrnvoid sql_error();rnvoid con(char *a);rnvoid process_input();rnvoid process_output(char *a,char *b);rnrnrnEXEC SQL BEGIN DECLARE SECTION;rnchar sql_stat[800];rnchar username[10];rnEXEC SQL END DECLARE SECTION;rnrnrnrnlong SQLCODE;rnrnint main(int argc,char *argv[])rnrnrn char pname[100];rn rn rn EXEC SQL BEGIN DECLARE SECTION;rn char name[30];rn char t_name[15];rn EXEC SQL END DECLARE SECTION;rnrn strcpy(sql_stat,"select");rn strcat(sql_stat," ");rn strcpy(t_name,argv[2]);rn EXEC SQL WHENEVER SQLERROR DO sql_error();rn con(argv[1]);rn EXEC SQL ALLOCATE DESCRIPTOR 'input_descriptor';rn EXEC SQL ALLOCATE DESCRIPTOR 'output_descriptor';rn rn EXEC SQL DECLARE BB CURSOR FOR SELECT column_name FROM dba_tab_columns WHERE lower(table_name)=:t_name and rnrnlower(owner)=:username;rn EXEC SQL OPEN BB;rn EXEC SQL WHENEVER NOT FOUND DO BREAK;rn for(;;)rn rn EXEC SQL FETCH BB INTO :name;rn strncat(sql_stat,name,sizeof(name));rn strcat(sql_stat,",");rn rn EXEC SQL CLOSE BB;rn strcat(sql_stat,"\b");rn strcat(sql_stat,"from");rn strcat(sql_stat," ");rn strcat(sql_stat,argv[2]);rn printf("%s",sql_stat);rn cout<<"检测"<
此题以困扰我很久了!!!!
若有说明语句:int x=1,y=0;则表达式x-->(y+x)?5:25>y++?'1':'2'的值是rn答案为什么是5啊???x--不应该是先使用后自减的吗?x-->(y+x)不应该是1>1+0不应该是取后面一个表达式的值吗??rnrn
select 语句怎么写?困扰很久了
有emp 表rnrndeptID empNamern1 张三rn1 李四rn1 王五rn2 Billrn2 leorn2 CCrnrnrn要实现的效果的是每个部门的第一条记录如rnrndeptID empNamern1 张三rn2 Billrnrnrn怎么写啊?rn
相关热词 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池 c#5.0 安装程序 c# 分页算法